AppleScript Performance Test: Difference between revisions

From Wurst-Wasser.net
Jump to navigation Jump to search
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Timo and Rahul told me that they experience ''slight'' differences in execution speed of [[AppleScript]]s depending on how they have been saved. Now, some tests:
Timo and Rahul told me that they experienced ''slight'' differences in execution speed of [[AppleScript]]s depending on how they have been saved. Now, some tests:


=== Testing equipment  ===
=== Testing equipment  ===
Line 31: Line 31:
| Script, Run Only
| Script, Run Only
| [[Image:ASPerfTest01.png]]
| [[Image:ASPerfTest01.png]]
| 16, gestartet via FastScripts<ref>because double-click only...<br>[[Image:ASPerf11.png]]</ref>
| 16, launched with [[FastScripts]]<ref>because double-click only...<br>[[Image:ASPerf11.png]]</ref>
|-
|-
| Application, Run Only
| Application, Run Only
Line 43: Line 43:
| Script bundle
| Script bundle
| [[Image:ASPerfTest04.png]]
| [[Image:ASPerfTest04.png]]
| 18, gestartet via FastScripts
| 18, gestartet via [[FastScripts]]
|-
|-
| Script bundle, Run Only
| Script bundle, Run Only
| [[Image:ASPerfTest09.png]]
| [[Image:ASPerfTest09.png]]
| 19, gestartet via FastScripts
| 19, launched with [[FastScripts]]
|-
|-
| Application bundle
| Application bundle
Line 59: Line 59:
| Text
| Text
| [[Image:ASPerfTest08.png]]
| [[Image:ASPerfTest08.png]]
| 19, gestartet via <tt>osascript</tt>
| 19, launched with <tt>osascript</tt>
|}
|}


Line 72: Line 72:


[[Category:AppleScript]]
[[Category:AppleScript]]
[[Category:Mac OS X]]

Latest revision as of 10:37, 11 April 2024

Timo and Rahul told me that they experienced slight differences in execution speed of AppleScripts depending on how they have been saved. Now, some tests:

Testing equipment

  • Machine: Heiko's MacBook Pro 15" 2.2GHz, 4GB, MacOS X 10.5.8
  • Script:
set vorher to current date
set t to 231
tell application "Finder"
	activate
	repeat t times
		set n to make new Finder window
		tell n to close
	end repeat
	set nachher to current date
	set dauer to nachher - vorher
	log dauer
	display dialog "Dauer: " & dauer & " Sekunden." buttons {"Doh!"}
end tell

Testergebnisse

Kind Saving-Options-Screenshot Execution time (seconds)
Script im Script Editor ASPerfTest00.png 31
Script, Run Only ASPerfTest01.png 16, launched with FastScripts[1]
Application, Run Only ASPerfTest02.png 89
Application ASPerfTest03.png 88
Script bundle ASPerfTest04.png 18, gestartet via FastScripts
Script bundle, Run Only ASPerfTest09.png 19, launched with FastScripts
Application bundle ASPerfTest06.png 86
Application bundle, Run Only ASPerfTest07.png 86
Text ASPerfTest08.png 19, launched with osascript

Bottom line

Applications are damn slow, every other variant is equally fast.


  1. because double-click only...
    ASPerf11.png