I have a large iPhoto library (pictures only) of about 40 gigabytes since I recently merged the various iPhoto libraries into one. In doing so however, the library became unbearably slow to work with. Anything I would do, including just a simple scroll through the photo library would cause the application to hang with the infamous color full beach-ball like cursor twirling.
I sincerely initially though this was to the slow I/O of traditional hard drives. So with my new MacBook Air 2012, I decided to move my entire library to leverage the super fast SSD. To my surprise, the performance of iPhoto was identical. The MacBook Air is even an upgraded system with extra ram & storage, so I knew it couldn't be the disk I/O.
My search for the solution lead me to various people describing a special "diagnostic screen" of iPhoto shown below which opens when you launch iPhoto with the Command + Option keys pressed.
Since the last option below indicates to try only if the above options do not resolve the matter, I decided to start each option top down. The first option ran rather quickly and didn't improve the performance. The second option however did take a very long time to complete. Even on an high performance SSD drive of a MacBook Air, it took a good hour to complete. I imagine it would take over four hours to complete with a regular hard drive and a similarly sized iPhoto library. After completion, I can confirm, at least with my experience, iPhoto ran more smoothly with very few occurrence of the "BeachBall" cursor appearing. Since the 2nd option provided so much improvement, I decided to apply the 3rd option to my library as well. So far I went from a practically unusable library to a library I was able to show to some co-workers who happening to be considering a Mac purchase.