Most of the following tests are done on Linux and with the
MySQL benchmarks, but they should give some indication for other
You get the fastest executable when you link with
-static. Using Unix
sockets rather than TCP/IP to connect to a database also gives better
On Linux, you will get the fastest code when compiling with
-O6. To compile `sql_yacc.cc' with these options, you need 180M
gcc/pgcc needs a lot of memory to make all functions inline.
You should also set
CXX=gcc when configuring MySQL to avoid
inclusion of the
If you use
pgcc and compile everything with
mysqld server is 11% faster than with
If you link dynamically (without
-static), the result is 13% slower.
If you connect using TCP/IP rather than Unix sockets, the result is 7.5%
On a Sun SPARCstation 10,
gcc 2.7.3 is 13% faster than Sun Pro C++ 4.2.
On Solaris 2.5.1, MIT-pthreads is 8-12% slower than Solaris native threads.
The MySQL-Linux distribution provided by TcX is compiled with
pgcc and linked statically.