Photoshop script in OS 9 vs X

I ran a time test of 1000 files being processed with AppleScript in Photoshop 5, with Photoscripter in OS 9 vs Photoshop 7 in OS X. The batch takes a 2MB file reduces it to 500K applies the unsharp mask filter and saves the file in a different directory.

The OS 9 test ran in 1hour 16 minutes and the OS X ran in 2 hours 12 minutes. Any ideas why the time nearly doubled?

Celli

You didn’t give much info about the hardware and software configurations and conditions that you used for testing, so it’s really impossible to guess why there’s so much difference in the times.

There are probably several things that could affect the time. On pre-OS X setups, one can boost the amount of RAM allotted to an application. This can have a tremendous impact on speed. In OS X, the OS controls RAM allotments. If several apps are running at the same time, and all physical RAM is in use, OS X will start creating swap files (moving data out of RAM and onto the hard drive - sort of like virtual memory). This means more disk reading and writing. This could slow things down dramatically. Closing apps that aren’t needed can sometimes speed things up by freeing up the installed RAM.

– Rob (not an expert on these matters)

No other applications were open when the tests were running in either system.

Could Photoshop 7 be running slower than Photoshop 5 when ran on the same computer? I had hoped that OS X would make up some time, being more efficient than 9.

I am attempting to set up a script in OS X that could run as many as 5,000 to 10,000 images in a single batch. I need to find every option of optimizing the code possible. OS 9 always began slowing down after 3000 images. I hope that OS X will not have that issue.

I don’t have Photoshop so I can’t comment on it specifically. If your script starts slowing down after x number of operations, maybe you could have it quit and restart every so often. It’s hard to say if this would help or not without knowing how well the script is optimized already. I’m no expert when it comes to this type of stuff so hopefully one of the more skilled scripters can provide the info that you seek. :slight_smile:

– Rob (not really an expert at much of anything now that I think about it)

Rob is correct about script optimization, for example there is a huge difference in performance between:


set theList to {}
repeat with i from 1 to 1000
 set theList to theList & i
end repeat

and


set theList to {}
repeat with i from 1 to 1000
 set end of theList to i
end repeat

The first way of adding to a list gets progressively slower as the list length increases.

Shameless plug, I have recently finished an application that is designed to do the sort of thing that you are trying to do, and because it does not have a user interface to maintain it is much faster at this sort of image processing than apps like photoshop.

I am in the last stages of getting the website up and running, and I haven’t put an application download on the website yet, but I will be doing so tomorrow. The rather beta version of the website, and this is the first public mention is:

http://www.yvs.eu.com

Kevin