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

Windows, compiling : RelWithDebInfo should use /Ob2 for more aggresive inlining

    XMLWordPrintable

    Details

      Description

      By CMake's default, RelWithDebInfo compiles with /Ob1 option, which is inlining everything that is marked for inlining but nothing else (see reference). However certain template function in the SDK are not explicitely marked inline. Which makes compiler to create non-inlined functions. In some situations this does not work very well . For example atomic store (including memory_order_relaxed) would call a template function Atomic_reinterpret_as() ,which was compiled for some template parameters, to a dummy function.

      If more agressive inlining is enabled, like /Ob2 (default for Release/MinSizeRel), then Atomic_reinterpret_as generates no instructions.

      Given Innodb's extensive use for atomics (specifically relaxed ones, to please TSAN), the call() instruction overhead on every load of atomic becomes too high, and measurable in recent 10.8 benchmarks, as much as 5-10%.

        Attachments

          Activity

            People

            Assignee:
            wlad Vladislav Vaintroub
            Reporter:
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.