Recommended Flags
For good overall performance the following Sun Studio flags are recommended:
-g -fast -zlazyload
Performance vs. Tuning and Compiler Flags
| Optimization Level | Performance |
|---|---|
| GCC compiled at -O2 (SunFreeware.com) | 49% |
| -O3 | 100% |
| -O4 | 107% |
| -fast, -xprofile | 123% |
| -fast, -xprofile, -xipo | 123% |
- The benchmark used to generate performance data in the table above uses ImageMagick's "convert" to resize, crop and reformat a 200 KB JPG image.
- The linker option -zlazyload delays the loading of shared objects until they are actually needed. If the flag is not used then ImageMagick's "convert" will load dozens of shared libraries at startup incurring an unnecessary delay of over 20 milliseconds every time convert is invoked. Using -zlazyload results in a speedup of 9% on an UltraSPARC IV+ system when converting 150 KB input images and 2% with 450 KB images.
- Further performance gains of 1-2% can be attained by downloading and building libpng, jpeg-6b and zlib with -fast optimization.
Notes
- Performance results were measured on a V490 with 1.5 GHz UltraSPARC IV+ CPUs.
Configure Invocation
export CC=cc export CXX=CC export CFLAGS="-g -fast" ./configure
Build Notes
- To allow the same code to be called from multiple command line invocations (convert, animate, etc.) the bulk of the code resides in a shared library (libMagick.so). Because -xprofile capability is not currently supported with shared libraries, the 4% speedup reported above from using this flag was attained by building a version of convert by hand that moved the code from libMagick.so into the convert executable. Advanced users can enable feedback directed optimization by creating a compile script by redirecting output from make to a file that can be edited to include the -xprofile=<collect|use> flags.
Known Compile Issues
None
Scripts
- <add script to automatically compile using -xprofile>

- <add benchmark script and images>
