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

hashicorp_key_management_plugin.cc uses expensive clock() call for no good reason

    XMLWordPrintable

Details

    • Related to performance
    • Hashicorp Key Management plugin improved performance by avoiding calling expensive time retrieval functions
    • Q3/2026 Server Maintenance

    Description

      As shown in MDEV-12345, frequent calls to clock() are prohibitively expensive.
      But they are used in hashicorp plugin code, in performance critical path, for no good reason.
      We do not want to measure CPU usage by thread or process, we want to measure time differences.

      C++11 has easy portable ways around it

      auto _now = std::chrono::high_resolution_clock::now();
       
      auto time_diff_in_ms =  auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(_now - _then);
      

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1h
                1h

                Git Integration

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