Re: How to access iTunes using cocoa
Re: How to access iTunes using cocoa
- Subject: Re: How to access iTunes using cocoa
- From: has <email@hidden>
- Date: Wed, 27 Jan 2010 07:37:03 +0000
Michael Ash wrote:
>>> I think a big hit comes from the time it takes to evaluate Apple event
>>> object specifiers. [...]
>>
>> Complex AE object queries have the same benefit that SQL queries do: they
>> let the data source perform an efficient search. [...]
>
> 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.
DO uses pointers, not queries, so that wouldn't surprise me, given that the AE bottleneck nowadays is query evaluation, not message passing. And there are other ways to achieve query-driven efficiencies in that sort of environment - e.g. F-Script's array-oriented programming model comes to mind.
Mind you, DO comes with its own set of problems, most of which step from its pretense that remote objects can be treated like local objects, so I'd be very leery of promoting it as the solution to AE's shortcomings:
http://jens.mooseyard.com/2009/07/the-subtle-dangers-of-distributed-objects/
It may be the answer lies somewhere in-between: an explicit network messaging API with the ability to perform [read-only?] queries, but which mostly uses safe pointer and one-message-one-object semantics for simplicity, speed and safety. Some sort of session/transaction management would be nice too (to avoid multiple clients manipulating objects at the same time). And no more four-char-codes, of course.
Regards,
has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
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