Re: tells and naked results
Re: tells and naked results
- Subject: Re: tells and naked results
- From: John W Baxter <email@hidden>
- Date: Sun, 3 Mar 2002 21:23:33 -0800
At 20:54 -0800 3/3/2002, John S. Baltutis wrote:
>
John Baxter wrote:
>
> Sun, 3 Mar 2002 18:07:12 -0800
>
> To: AS lists <email@hidden>
>
> From: John W Baxter <email@hidden>
>
> Subject: Re: Damn send button / Wind chill
>
> <snip>
>
> Ran this, which did show a difference between current date inside one (or
>
> two) tells, and a naked current date (500 was not enough repetitions...all
>
> results were 1; kept the style of reporting results backwards):
>
>
>
> set repetitions to 20000
>
> set time1 to the current date
>
> repeat repetitions times
>
> tell application "Finder"
>
> tell application "BBEdit 6.5"
>
> current date
>
> end tell
>
> end tell
>
> end repeat
>
> set time2 to the current date
>
> repeat repetitions times
>
> tell application "BBEdit 6.5"
>
> current date
>
> end tell
>
> end repeat
>
> set time3 to the current date
>
> repeat repetitions times
>
> current date
>
> end repeat
>
> set time4 to the current date
>
> {time4 - time3, time3 - time2, time2 - time1}
>
> --> {9, 53, 53}
>
> -- units are seconds; machine is dual 533 with plenty of RAM, Mac OS X
>
> 10.1.3; AS 1.8.1
>
>
Running BBEdit Lite 6.1.2, G4 dual 450, 1.5 GB RAM, Mac OS 9.2.2, AS
>
1.8.2b1, yields:
>
-> {13, 88, 125}
OK, NOW we have a difference larger than experimental error (meaning I was
quite possibly wrong to ascribe all of the 2 to 3% difference previously
noted to experimental error).
We should run this test with a fourth case and a fifth case (or just ditch
the naked case, since it is uninterestingly faster and the "right way" to
do current date and other non-interactive Scripting Additions).
Make BBEdit the outside tell, and Finder the inside. My expectation is
that the results of that case will be nearly the same as the results of
just the tell Finder.
And the last new case is a single level tell of the BBEdit...where I expect
the results to be similar to the nested tell with tell BBEdit inside tell
Finder.
If you get those results (I don't have the equipment to run it), I'll claim
that the difference is simply that in that environment, the Finder is
faster at not accepting unknown (to it) Apple events than BBEdit is.
I don't know whether to ascribe that to the different BBEdit versions, or
the different OS, or some of each.
=====
[Why "non-interactive scripting additions" above?
Reason one...we're waiting for an incredibly slow part of the system--the
human. How long it takes us to start waiting and to clean up after waiting
makes a vanishingly small difference.
Reason two...you want the interactive ones executing within the application
which is naturally frontmost at the moment [includes consideration of user
expectation] (almost always...there are exceptions to be found for every
statement of that nature).]
--John
--
John Baxter email@hidden Port Ludlow, WA, USA
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.