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

Performance : Remove calls to clock() in trx_start_low

Details

    Description

      The point-select sysbench benchmark I ran recently on 10.2 shows rather high time spent in
      high resolution timer syscalls (clock_gettime on Linux, and QueryPerformanceCounter on Windows)

      The inspection reveals that clock() call introduced inside trx_start_low by this patch https://github.com/MariaDB/server/commit/74961760a4837d2deb33336329c28cf9ad9b4e9e is responsible for the most calls (also, in 10.2, clock() was erroneously done twice).

      The call can be replaced by the value of THD::start_utime.

      Attachments

        Activity

          Attached callgraph data taken with perf during the sysbench run

          wlad Vladislav Vaintroub added a comment - Attached callgraph data taken with perf during the sysbench run

          The fix looks OK to me.

          marko Marko Mäkelä added a comment - The fix looks OK to me.

          Attached are the non-transactional point-select benchmark numbers ran with 256 user on a 32core machine (it is 10.2)., with or without clock() in trx_start_ow. Quite surprising speedup (more than 3 times, from 126325 to 379186 qps). On a weaker Windows box that I have tested, it was more like 15% improvement. clock_get_time must be very expensive on this benchmark machine.

          wlad Vladislav Vaintroub added a comment - Attached are the non-transactional point-select benchmark numbers ran with 256 user on a 32core machine (it is 10.2)., with or without clock() in trx_start_ow. Quite surprising speedup (more than 3 times, from 126325 to 379186 qps). On a weaker Windows box that I have tested, it was more like 15% improvement. clock_get_time must be very expensive on this benchmark machine.

          Fixed in 10.1 now

          wlad Vladislav Vaintroub added a comment - Fixed in 10.1 now

          People

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