Monday, September 05, 2005

iCal Doesn't Handle Large Calendar Files Well

I don't know what it is about iCal. Ever since it's launch, people have been complaining about how it's as slow as dirt.

I'll have to throw my voice into the chorus. Although now it's worse than it's ever been before. It takes 57 seconds to go from the time I click the iCal icon in the dock to the time I can see the events scheduled in the calendar. Yes, that's right, 57 seconds - nearly a minute just to open up.

Another things that is extremely slow is copy and paste. I use this frequently to add events to a later point. The copy part is fine; it happens instantaneously. It's the paste part that's screwed up. It takes at least 6 seconds every time I want to paste something as I get to enjoy the spinning ball.

Another thing that was happening is that when I quit I was getting the message "Synchronizing your modifications..." with one button that said "Abort and Quit."

Now I've got a PowerBook G4 on Mac OS X 10.4.2 with a 1.5 GHz PowerPC G4 and 1 GB DDR SDRAM. I've got a .Mac account and my connection to the internet is a broadband cable connection (in any case, .Mac synching has been off for some time). My hardware does not seem to line up with such crappy performance. As it must be a software problem, I set off to fix it.

I began digging through Apple's support pages and came up with this message board. The post has the following suggestions, all of which I gave a shot:
  1. Trash the iCal preferences at ~/Library/Preferences/com.apple.iCal.plist (I also trashed ~/Library/Preferences/com.apple.iCal 13-53-46.plist, ~/Library/Preferences/com.apple.iCal.alarmsCache.plist, ~/Library/Preferences/com.apple.iCal.AlarmScheduler.plist, and ~/Library/Preferences/com.apple.iCal.helper.plist, just to be sure).
  2. Stop any syncing activities (I had already done this a long time ago in an attempt to speed things up).
  3. Stop any publishing and subscribing activities.
  4. Turn off the birthday calendar.
These steps got iCal to open in about 45 seconds and the "Synchronizing your modifications..." message no longer appeared, but still there's obviously a big problem in there.

I then created a new user on my computer to see if the problem existed with other users. It did not. With the new user, iCal opened in 3 seconds and felt crisp and quick. So now I know it's not iCal but something specific to my user.

So the message board goes on with its suggestions:
  1. Back up the database and revert to the back-up.
  2. Export, delete, and then import all of your calendars.
So I set off to try all of this out. First I made a back up of ~Library/Application Support/iCal/. (As a side, before Tiger, the iCal files used to be stored in ~Library/Calendar/ and in the format CalendarName.ics. They've been moved and are now stored in some funky naming format that keeps Spotlight from finding them in a normal search and that looks a lot like the naming method for pictures in Address Book.)

So I tried the first one. After reverting to the back-up, I got the "Synchronizing your modifications..." message again, despite having turned off .Mac synching. And this time it took a long time to get through the process. After quitting, it took a full 63 seconds to load up again and despite making no modifications whatsoever, I again go the "Synchronizing your modifications..." message when quitting. However, I tried it a few more times, and now it was taking just under 45 seconds to start up. The synchronization message continued to appear most of the time, although occasionally it did not. So that essentially did nothing.

So then I tried the second one. I exported all of my calendars and deleted them. While I had them all deleted, I decided to see if it would open quickly when it wasn't opening any of my calendars. It only took five seconds to open. The conclusion here is that whatever the problem is it's located somewhere in my calendars.

This led me to a hypothesis. I have one calendar, Education 1, that is huge - 1.7MB. It contains all my school schedules from the end of high school, college and law school and all events and to-dos related to those. So instead of importing all of the files, I decided to leave that one and to see what would happen.

When I quit, the synchronization message came up again and took a while to finish. When I opened iCal up, it took 15 seconds to display the events in the calendar pane. Copying and pasting took about 2 seconds. Still more sluggish than I would like, but at least it was useable.

So then the next test: adding in Education 1. When I added it back in, it went through the synchronization message relatively quickly. However, when I reopened the app, I was pleased to see that it only took 25 seconds to open instead of the 45 I was at before. I can understand if it takes a little longer to load the data from a big file like that.

However, it seemed to still be dragging the whole app down. The pasting part of copying and pasting was taking about 8 seconds. The app was otherwise sluggish, although nothing else that I could find in a quick five-minute session of playing around with iCal was so sluggish as to make the spinning ball appear.

So what seems to be happening is that my very large calendar causes iCal to 1) take a longer time to load and 2) take a ridiculously long time to paste an event that has been copied. The solutions I found on the message board cut the load time from 55 seconds to just 25, but did nothing for the pasting problem. Rather than being something quirky about files on my computer, this seems like iCal is just poorly written, reminding me of iPhoto a few versions ago when it was as slow as dirt too.

So I'll be giving a call to Apple Care. But if anyone else has any ideas what can be done about this, please let me know.