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

Remove bloat caused by InnoDB logger class

    XMLWordPrintable

Details

    Description

      Default implementation of InnoDB logger class uses std::stringstream inside.
      STL streams are famous for generation lots of bloat code after compiling.

      Usage of logger class in hot functions, which is typical for error handling,
      generates a lot of code which is inlined right in the invocation point, and
      99.99% of time this code isn't used. This leads to a huge instruction cache
      waste.

      We can point the compiler at the fact, that any logging is an expremely rare
      operation for database, so the compiler can reduce unnecessary inlining and
      pessimize 'cold' logging branches, meanwhile optimize really hot branches
      and reduce intruction case misses.

      Profit: in our tests, this optimization results in up to 2% performance
      increase in sysbench OLTP PS/RO/RW tests.

      Suggested fix:
      Mark all public logger method and all derived class contructors with 'cold'
      and 'noinline' attibutes.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              dmitriy.philimonov Dmitriy Philimonov
              Votes:
              1 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.