On 2006-10-04, at 16:51:18, Emmanuel wrote:
OMPBG4, XMLLib is 6+ times faster in this exercise (3.5 ms vs 24 ms.)
Just for comparison, in case anyone is interested, I ran this:
script setest tell application "System Events" set p to (property list file (path of file "com.apple.dashboard.plist" of preferences folder)) value of property list item "locale" of p end tell end script run script setest
in Terminal as:
# time osascript setest.scpt
with results:
en_US
real 0m0.302s user 0m0.114s sys 0m0.033s
And then I ran this:
script xmll set f to ("" & (path to preferences folder) & "com.apple.dashboard.plist") set p to PlistOpen file f PlistGetKeys p PlistGet p key "locale" end script run script xmll
with results:
en_US
real 0m0.347s user 0m0.122s sys 0m0.040s
I believe osascript is a fairer test because it creates a new component instance and properly calls CloseComponent() for each invocation. Therefore the load costs are factored in. Or as Aretha Franklin might have said: "Who's zoomin' who?".
|