Re: Activating applet or app?
Re: Activating applet or app?
- Subject: Re: Activating applet or app?
- From: Kai Edwards <email@hidden>
- Date: Wed, 10 Apr 2002 04:25:22 +0000
I recently wrote:
>
I got some interesting results when I last compared the times taken to perform
>
a basic AS routine in four different ways. (I'll post them separately to avoid
>
making this note too fat!) 8-P
The tests involved:
a: Excel not activated / routine outside Excel tell block
b: Excel not activated / routine inside Excel tell block
c: Excel activated / routine inside Excel tell block
d: Excel activated / routine outside Excel tell block
The test script looked like this:
------------------------------------
set n to 10000
set t1 to the ticks
repeat with i from 1 to n
set x to i + 1
end repeat
set t2 to the ticks
tell application "Microsoft Excel"
set t3 to the ticks
repeat with i from 1 to n
set x to i + 1
end repeat
set t4 to the ticks
Activate
set t5 to the ticks
repeat with i from 1 to n
set x to i + 1
end repeat
set t6 to the ticks
end tell
set t7 to the ticks
repeat with i from 1 to n
set x to i + 1
end repeat
set t8 to the ticks
{t2 - t1, t4 - t3, t6 - t5, t8 - t7}
-- (a, b, c, d)
------------------------------------
The results (from a fairly slow machine) looked like this:
run1 run2 run3 run4 run5 run6 run7 run8 run9 run10
---- ---- ---- ---- ---- ---- ---- ---- ---- -----
a: 46 51 51 51 46 50 43 49 48 49
b: 49 63 54 50 49 53 47 49 53 60
c: 72 76 74 72 72 68 69 75 72 71
d: 59 59 56 61 56 64 62 59 60 50
- which translated into the following
average (ticks) and index (slowest = 100):
average index
------- -----
a: XL not activated / no tell 48.4 67
b: XL not activated / with tell 52.7 73
c: XL activated / with tell 72.1 100
d: XL activated / no tell 58.6 81
However, to put matters into a more practical context, a *single* activate
command averaged nearly 30 ticks (giving it an index of about 40). And with
more complex routines - especially if a significant amount of the workload
can be performed by Excel's functions - I'd still favour putting Excel 'up
front'.
--
**********************************
Kai Edwards Creative Resources
1 Compton Avenue Brighton UK
Telephone +44 (0)1273 326810
**********************************
_______________________________________________
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.