On Jan 26, 2010, at 11:13 AM, has wrote:

The Apple Event Object Model was optimized for System 7, where IPC was extremely expensive

I know; I was on the AppleEvents engineering team at the time :)

IPC is still extremely expensive, by the way, although not quite as much so. The actual OS-level process switch is faster, but there is still a lot of work involved in marshalling and unmarshalling data.

so generally works best if you can use a few complex commands rather than lots of simple commands.

Agreed. The problem is that iTunes doesn't implement the complex commands well. A lot of them either fail, or are implemented using linear search instead of querying the database.

For example, you can't get properties of multiple items:
        album of every track of every playlist whose artist is "The Beatles"
fails with error "Handler only handles single objects". Instead you have to remove the "album of" part, get back a list of object specifiers, and loop over them getting the album names. Which of course involves lots of IPC calls.

There are other cases of 'whose' queries that take extremely long to run, depending on the size of your library, because they do a linear search. Try this:
        id of every track whose played count is 1234
On my 2.4GHz MacBook Pro this takes 15 seconds to run, with iTunes consuming 100% CPU. (I do have 10,000 tracks in my library.) By comparison, creating a smart playlist in iTunes with the same criteria is instantaneous.

—Jens_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to