Ad-hoc and generalized guidelines exist for optimizing Photoshop performance, but relating a particular workload size to memory and scratch volume requirements is usually left as an “exercise for the reader.
I will present specific and actionable research into Photoshop CS4 performance on the Mac Pro and MacBook Pro (most of which applies to Windows PCs as well). Processing time can be cut by as much as 80% by appropriate choice of the amount of memory and the speed of the scratch volume, and by some key configuration parameters of Photoshop itself. Compare that to the modest 14% speed difference and huge cost difference of a 3.2GHz versus 2.8GHz Mac Pro.
Workloads that force Photoshop to swap image data to and from the scratch volume include not only very large files, but also files with many layers, steps, or operations. With these demanding f iles, overall processing time is influenced far more by adequate memory and fast hard drives than by CPU speed. CPU speed does matter when executing Unsharp Mask or Gaussian Blur or similar filters with the entire image in memory. Once the image cannot be held in memory, CPU speed is a minor point.
(For more information on many areas covered here, see MacPerformanceGuide. com, or MPG, a Web site I’ve created to cover these issues.)
The research conducted here used a medium and large Photoshop “action” (script) composed of operations chosen to stress the memory requirements of Photoshop. Two benchmarks were used: diglloydMedium and diglloydHuge. Upon completion, the diglloyd Medium action results in a 15.6GB scratch f ile, and diglloydHuge results in a 56.4GB scratch f ile. You can download the benchmarks at MPG.
Configuring Photoshop CS4 incorrectly causes a performance hit of up to 70% (120% for CS3); so optimal configuration by itself might be enough improvement to forgo hardware upgrades. The benchmark results seen in Tables 1, 2, and 3 were measured with the optimal plug- in/preference conf iguration; execution times would otherwise be much longer.
Here are the really important areas to configure:
Plug-ins: Install the BiggerTiles and DisableScratchCompress plug-ins. Older versions of Photoshop might also need to use the ForceVM Buffering plug-in, but this is on by default with Photoshop CS4/CS3 and Mac OS X 10.5. Execution time is up to 50% slower with CS4 and 120% slower with CS3 without these plug-ins!
Histogram panel: Hide the Histogram panel for up to 10% faster execution of long-running scripts; with large files, Photoshop is accessing the scratch volume to build the histograms. The same applies when working interactively.
Memory usage: Mac systems with 4GB or more of system memory should set Photoshop’s preference Let Photoshop Use to 100%, assuming it is not competing with other active applications for memory. Save memory by minimizing History States and Cache Levels (you can also set History States to 1 for long-running batch operations or scripts, so Photoshop need not maintain history). See Figure 1.
Scratch Disk: Set Photoshop’s scratch disk to the fastest available volume (it’s actually a volume, not a disk), preferably a fast striped RAID as discussed in the benchmark results later in this article. The scratch volume (not shown) is set in the Performance preferences just under the Memory Usage area.
Memory and scratch volume
The maximum size of the scratch file(s) correlates closely with how much physical memory is required for eff icient operation. For your most demanding use case, add up the scratch file sizes for all the files you have open, after you’ve done your normal workflow. The scratch file size can be seen in several places in Photoshop, including the Info Panel. As seen in Figure 2, it’s 15.8GB.
The rule of thumb for memory, in GB, is: Memory = 2 + ScratchFile Total (round this up to the nearest 4GB).
The two extra gigabytes account for system overhead and the usual need to run at least a few other programs such as mail or Web applications, and a Raw-file converter. If you’re running Photoshop all by itself, you can omit the +2 factor. For optimal memory performance, always install memory in a matched set. For an Apple Mac Pro, this means a set of four FB-DIMMS matched in size—e.g., four 4GB modules totaling 16GB, four 2GB modules for 8GB, etc. See MPG for more. Go straight to eight 4GB modules (32GB) if you work with monster files. You must restart Photoshop after changing performance preferences.
Test results for Mac Pro
The table below captures the diglloydMedium and diglloydHuge benchmark test times using 8/16/32GB of memory with 1/2/3/4/5/6 drives. With two drives or more, a striped RAID volume (32K stripe size) was used, carving off the fastest 32GB partition from each drive. The six-drive striped RAID is capable of sustained input/output of about 580MB/second. The drives were 1 terabyte (TB) Seagate ES.2 enterprise- class drives. See MPG for how to create a striped RAID and test it.
The results show that a basic configuration of 8GB with a single hard drive is a losing proposition, with the largest absolute gains achieved by very simple means: 16GB memory and two hard drives as a striped RAID. Gains accrue more slowly beyond that, but are still substantial for really large files.
Memory rule-of-thumb: as long as the installed memory is roughly the same as the total scratch size, more memory offers no further improvement.
Hard drives rule-of-thumb: three drives is near-optimal (perfect for the four-bay Mac Pro), but four to six drives can improve performance further for larger workloads.
Adding 32GB memory did not improve performance for diglloyd Medium, because 16GB was already adequate for Mac OS X to cache the data written to the scratch disk by Photoshop. Determining the scratch size requirements is essential to knowing how much memory is needed (see earlier discussion).
It’s not a mistake that the 32GB configuration is slightly slower thanthe16GBconfigurationon diglloydMedium: a Photoshop CS4 bug actually reduces the memory Photoshop will let itself use (2,810 instead of 3,072MB).
Choice of hard drive brand/model
Forget about Firewire 800 and USB 2.0—they are useless for high performance. Use SATA (standard and inexpensive) or SAS (special hardware, expensive). Only SATA drives were tested here. Among SATA drives, the choice of brand/model has a significant influence on speed, but speed also varies depending on whether built-in SATA ports/bays are used or what brand of SATA card and external enclosure are used.
Performance is best with current model high-capacity hard drives (1TB) with 32MB on-board caches. Lower-capacity and/or older drives don’t perform as well. Table 2 shows the performance realized with various brands/models of hard drives. There is only a 13% gap in performance between the fastest and slowest 1TB hard drives, so a cost difference of up to 50% may be a deciding factor for some users.
It’s critical to avoid “port multiplied,” e.g., PM enclosures, which throttle performance to about 220MB/sec (a single SATA cable is used,sharedbyalldrives).Thetimes in Table 2 show a 29% performance penalty for the fastest-performing
Western Digital RE3 drive used in a “port multiplied” enclosure.
Results with specialized drives such as the 10,000 rpm Western Digital Velociraptor should be excellent (not tested). However, the Velociraptor is two to three times more expensive than the 1TB drives, with 1/3 the capacity. Three of the fastest 1TB drives should easily outperform two Velociraptors, at 1/3 the expense. Be sure to use a dedicated striped RAID 0 scratch volume composed of the fastest outer tracks of each drive. Disk-drive head contention will not be an issue in Photoshop, even if the remainder of the drives stores the image files.
Test results for MacBook Pro
The MacBook Pro is naturally more constrained in its expansion options, but in November 2008 it became possible to install 6GB of memory. Coupled with a two-drive eSATA (external SATA) setup through the ExpressCard slot, much faster performance is possible.
Observe that the inexpensive Hitachi Deskstar 7K1000 was the top performer on the MacBook Pro, whereas it was a slower performer on the Mac Pro.
• On large files, a 2.4GHz MacBook Pro offers about 1/3 the performance of a 3GHz Mac Pro, (largely because of limited expansion options).
• Installing 6GB offers a 30% to 40% performance enhancement over 4GB, so this should be your f irst upgrade.
• A dual-drive, eSATA striped scratch volume offers about a 40% performance gain over the fastest possible internal drive partition (warning: an internal partition precludes use of Apple’s BootCamp, used to run Windows on a Mac).
• Hard-drive speed is critical: a 4GB system with dual eSATA can outperform a 6GB system without it.
•Internal laptop hard drives circa 2008 are considerably faster than 2006 models.
• Firewire 800 cuts performance by about 27% versus eSATA (difference likely greater for dual drives, but not tested). Therefore choose eSATA over Firewire 800.
As hard drives fill up, they slow down; I/O speed is about twice as fast on the outer tracks as the inner ones (see MPG for why and what to do about it). This is particularly relevant for laptop users; a drive contains the system and applications occupying the fastest part of the drive right away. As the drive f ills up, the Photoshop scratch file resides on a slower and slower part of the hard drive (it’s created each time Photoshop is started). Using the internal hard drive for scratch is therefore problematic over time, unless the drive is a solid state drive (SSD), which maintains steady performance over its entire capacity.
In late 2008, with memory prices at historic lows, and 1TB hard drives selling for barely more than $100, configuring a Mac Pro or MacBook Pro (or PC) for top Photoshop performance can be done at a modest cost. Anyone whose work involves Photoshop and large files will rapidly recoup the expense via immediate productivity gains.
The memory and drive-speed considerations for Photoshop apply similarly to any program making extensive use of large files, including video editing. Maximizing Photoshop performance as discussed here means a more responsive system, no matter what the task.