We use C++ from Oracle Solaris Studio (latest version) to build our 64-bit shared library,
and we found out that there is ~10% performance fluctuation depending on the build server,
that we use to link this shared library. For some reason starting address of one hot function
in this library may not be aligned to 16 bytes, and in this case the performance of this function
is low. Is there a way to tell C++ compiler to align this function (or all functions) to 16 bytes?
Our build servers are Solaris 10 SPARC. Performance is measured on T4 and M3000.
Compiler options are: -xO4 -xtarget=generic -g
The advanced compiler tuning options are listed here:
One of the flags controls function entry point alignment:
"-Qoption cg -Qiselect-funcalign= n
Align function entry points at n-byte boundaries. Aligning functions may make the instruction fetcher more effective on some machines. In general, this option causes the binary to be larger, and it may cause the I-cache to be less well packed. Default settings are likely to differ from machine to machine"