Optimal Sun Studio compiler options for MySQL

mysqlcompiler

We recently integrated MySQL 5.0.45 version with Open Solaris. MySQL 5.0.45 is available in SXDE 01/08. Sun Studio was used to compile MySQL on both Solaris SPARC and Solaris AMD64 platform.

This blog entry describes the changes that were made to improve MySQL performance using Sun Studio:

  • Enable function inlining when Sun Studio is used.
    • The header file univ.i has the following code:
      • #if !defined(GNUC) && !defined(WIN)
      • #undef UNIV_MUST_NOT_INLINE /\* Remove compiler warning \*/
      • #define UNIV_MUST_NOT_INLINE
      • #endif
    •  Modifying it to add Sun Studio compiler as under:
      • #if !defined(GNUC) && !defined(WIN) && !defined(__SUNPRO_C)
      • #undef UNIV_MUST_NOT_INLINE /\* Remove compiler warning \*/
      • #define UNIV_MUST_NOT_INLINE
      • #endif

  •   The following compiler options boost performance on both SPARC and AMD64:
    • -xbuiltin=%all' and ' -xprefetch=auto -xprefetch_level=3
  •   On SPARC setting the optimization level to 4 helps performance. (-x04).
  •  On AMD64 platform, the compilation of NDB fails with Sun Studio due to the following snippet in configure.in:    

case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in
  \*solaris\*-i?86-no-yes)
  # ndb fail for whatever strange reason to link Sun Forte/x86
  # unless using incremental linker
  CXXFLAGS="$CXXFLAGS -xildon"
  ;;

           The -xildon option is added for Solaris AMD64 platform ...which is no longer available.In previous releases, this option forced the compiler to use the incremental linker (ild) by default instead of the linker (ld) for link-only invocations of the compiler. That is, with -g, the compiler's default behavior was to automatically invoke ild in place of ld whenever you used the compiler to link object files, unless you specified -G or source files on the command line. This is no longer the case. The incremental linker is no longer available. Refer to the following for more details : http://docs.sun.com/source/819-3690/Comp_Options_App.html

                After removing this option, the compilation of ndb works fine.

  • On 32bit built , the release binary is using the following option: -features=no%except It is recommended not to use this option. Removing this option results in following error:
    • Undefined                       first referenced
       symbol                             in file
      __1cG__CrunMex_rethrow_q6F_v_       ../libmysql/.libs/libmysqlclient.a(ssl.o) 
            This error can be resolved by adding the -lCrun library at run-time



Comments:

Nice to see this post, Ritu.
Are you able to say anything about performance improvement from this effort?

Vijay

Posted by Vijay Tatkar on February 11, 2008 at 08:51 AM PST #

Yes, I do have the performance numbers , shall be posting them shortly....

Posted by Ritu Kamboj on February 12, 2008 at 05:13 AM PST #

How can I be a good developer of java

Posted by Assaduzzaman on April 14, 2008 at 05:20 PM PDT #

I love MYSQL, It one great database i would love to be with anyday anytime. but I need more in sight where i can diversfy the knowledge where people can really appreciate it`s power. At the moment all i do is use it with PHP on browsers for user to appreciate it.

Posted by Adenuga Agbolade on April 19, 2008 at 12:17 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Ritu Kamboj

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today