Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


64 bit? | 5 comments | Create New Account
Click here to return to the '64 bit?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
64 bit?
Authored by: bankshot on Sep 16, '09 08:53:07AM

I think the 64-bit mania is getting a little bit out of hand. AppleScript is certainly such a lightweight application that I can't possibly see it benefiting from running as 64-bit. I ran a few tests of my own scripts, and didn't find any difference in runtime between the standard 32-bit versions and 64-bit. It's easy to run your own test:

First, save the script as an application in Script Editor. Then in Terminal, change to the compiled AppleScript's "MacOS" directory. For example:

% cd myscript.app/Contents/MacOS

A compiled AppleScript should have 3 architectures in the "applet" executable. You can verify this with the "file" command:

% file applet
applet: Mach-O universal binary with 3 architectures
applet (for architecture x86_64): Mach-O 64-bit executable x86_64
applet (for architecture i386): Mach-O executable i386
applet (for architecture ppc7400): Mach-O executable ppc

Use the "lipo" command to extract individual executables of each architecture, and rename the existing executable to move it out of the way.

% lipo applet -extract x86_64 -o applet.x86_64
% lipo applet -extract i386 -o applet.i386
% lipo applet -extract ppc7400 -o applet.ppc7400
% mv applet applet.all

Now, to test any architecture, use the "ln" command to make a symbolic link (alias) to that executable named applet. For example, to test the i386 architecture:

% ln -sf applet.i386 applet

Try the different architectures and see if there's really any difference between i386 (32-bit) and x86_64 (64-bit). I couldn't find any.

I suspect the speedup has more to do with running the script natively rather than under Rosetta. I didn't install Rosetta on my Snow Leopard partition, so when I went to run an old script, it popped up asking if I wanted to install it. I recompiled the script instead. So I can't test the ppc architecture.



[ Reply to This | # ]