Choosing the right compiler and compilation options can make a huge difference in the performance of the simulations generated by McStas. Experiments show that using the HP C compiler with the right options generates code that runs more than twice as fast as code generated using GCC. Using the wrong options causes the HP compiler to generate worse code than GCC!
The performance of McStas has been tested on two systems. One, fys-hp-2, is an HPPA 9000/780 machine running HP-UX 10.20. The other, elm-298, is a 300MHz Pentium II PC running Linux 2.0.
On the HP machine, the best performance was found with the following compilation options:
cc -Aa +Oall -Wl,-a,archive ...This makes
cc spend a lot of time on compilation, but
the resulting code is twice as fast as that generated by gcc -O3,
not to mention cc -Aa -O which is even slower.
On the PII, the best performance seem to be obtained using
gcc -O3 ...
Using the fastest compilations options on both machines, the HP is about 50% faster than the PII.