The view from the Engine Room
Most common recent benchmarking mistake
Most frequently asked performance question of late: Why is this trivial piece of code slower on Solaris than on Linux with both OSes running on the same Opteron box?
Often this is because the default compilation mode using /usr/sfw/bin/gcc (or Studio, for that matter) on Solaris is always a portable binary - and 64 bit Solaris x86 isn't seen as a different architecture, since all the 32 bit programs still work just fine. So
gcc -o foo foo.c
produces a 32 bit binary on Solaris amd64, and a 64 bit binary when compiled on a 64 bit Linux. No wonder there's a performance difference! To get 64 bit compilation using gcc, simply use the -m64 flag:
gcc -o foo foo.c -m64
When in doubt, specify what you want - you'll more likely get what you need.
Posted at 08:40PM Jun 15, 2005 by barts in Performance | Comments[3]
Wednesday Jun 15, 2005
Posted by 216.58.44.227 on June 16, 2005 at 07:23 AM PDT #
Posted by Dmitri Trembovetski on June 16, 2005 at 08:28 AM PDT #
Posted by 208.237.173.72 on June 16, 2005 at 12:30 PM PDT #