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

replace pthread_getspecific() with C++11 thread_local in dbug.c

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Fix Version/s: N/A
    • Component/s: Debug
    • Labels:
      None

      Description

      thread_local is faster a simpler than function call. https://godbolt.org/z/whHsjI

      I'm running main suite tests in debug mode with -O2 optimizations, for example, for Spent 1556.669 of 260 seconds executing testcases and with thread_local, for example, for Spent 1484.632 of 246 seconds executing testcases.

      Patch requires transferring dbug.c from C to C++. C11 would fit too, but it's not used in MariaDB.

      Similar technique could be used also for THD and PFS.

        Attachments

          Activity

            People

            Assignee:
            kevg Eugene Kosov
            Reporter:
            kevg Eugene Kosov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration