Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23865

malloc function attribute will improve performance

    XMLWordPrintable

Details

    Description

      Description:
      GCC supports a malloc function attribute (https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attribu...) which tells that a function allocates a new unused memory chunk which allows compiler to do some optimizations.

      According to my investigation such attribute, applied on MySQL allocation functions like my_malloc, me_realloc, my_memdump, my_str(n)dup and some others, improves performance (sysbench used).

      Unfortunately the attribute is supported by GCC only (clang has similar attribute - allocator - but it is not used for optimization purposes), however MY_ATTRIBUTE macro able to handle it.

      So I would like to suggest to mark all memory allocation function with the attribute.

      How to repeat:
      Annotate all allocation function with MY_ATTRIBUTE((malloc)) and compare sysbench results

      Attachments

        Activity

          People

            danblack Daniel Black
            georgykirichenko Georgy Kirichenko
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.