Re: How to access iTunes using cocoa
Re: How to access iTunes using cocoa
- Subject: Re: How to access iTunes using cocoa
- From: Michael Ash <email@hidden>
- Date: Tue, 26 Jan 2010 20:16:35 -0500
On Tue, Jan 26, 2010 at 3:57 PM, Jens Alfke <email@hidden> wrote:
>
> On Jan 26, 2010, at 12:45 PM, has wrote:
>
>> I think a big hit comes from the time it takes to evaluate Apple event
>> object specifiers. The cost-benefit tradeoff of having a complex,
>> query-driven IPC system is much poorer on OS X, both in terms of performance
>> and ease of implementation (one of the reason so many apps have lousy AE
>> interfaces is because they're so damn hard to implement). The main
>> bottleneck on OS 7-9 was the OS-level messaging system; in OS X, it's
>> evaluating those complicated messages in the target application process.
>
> Complex AE object queries have the same benefit that SQL queries do: they
> let the data source perform an efficient search. No one would claim that
> MySQL's bottleneck is SQL parsing, or that it would be faster to let clients
> just iterate over table rows one by one! iTunes may not have as much data in
> it as a big database, bit it's still expensive to iterate over 10,000 tracks
> via IPC. It would be even worse for scripting the Finder, which operates on
> orders of magnitude more objects.
Would this actually matter in reality, though?
A quick experiment (on my 2006 Mac Pro) indicates that CFMessagePort
has a round-trip latency of roughly 100us, and with 1MB messages can
transfer about 500MB/sec.
On a more emperical level, some apps use Distributed Objects as an
AppleScript alternative, and the first thing you notice when going
from an AppleScript-based technique to a DO-based technique is that DO
is way, way faster.
There's certainly some theoretical niceness to the idea of being able
to send over a complex query and have the search be performed within
the app that already has the data, rather than simply making requests
and having to transfer all the data across before searching it. But on
a practical level, with Apple Events, the breakeven point seems to be
a quantity of data beyond what you'll find on most Macs.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden