RE: speed advantage of OSAXen
RE: speed advantage of OSAXen
- Subject: RE: speed advantage of OSAXen
- From: Olof Hellman <email@hidden>
- Date: Fri, 25 Jan 2002 15:16:56 -0800
Michael asks:
>
Do osaxen have any speed advantages over apps?
>
>
It strikes me that they don't -- they still involve an apple
>
event call, it's just to the system instead of an app. Maybe that makes
it
>
marginally faster, but it still takes aeons compared to a straight
>
language command.
>
There are very measurable speed advantages. When an application handles an
AppleEvent, a context switch is made to the application context, and the
event has to come in through the cooperative multitasking event dispatch of
MacOS. The exception is when an application dispatches an event to itself:
in this case there's no need for a switch because the app is already the
current process. (MacOS X changes the event dispatch quite a bit -- can
anyone comment on the situation there?)
No such context switch is required for events handled by OSAX -- they live
inside the system.
>
ASCII number/character is a perfect example.
Do you have data on how long this call takes? The standard additions OSAX
seems to be a special beast, in that its handlers are not installed in the
usual way ( no 'osiz' resource ) . I have no idea how it works.
- Olof