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

Windows : use GetSystemTimePreciseAsFileTime if available for high resolution time

Details

    • 10.3.6-1

    Description

      Currently, we're using GetSystemTimesFileTime for high resolution timers.
      Unfortunately, it is using system timer with accuracy 10ms to 55ms according to https://blogs.msdn.microsoft.com/oldnewthing/20170921-00.

      For system versioning, we need a more accurate timer, this is what GetSystemTimePreciseAsFileTime provides, but this is not available
      prior to Windows 8.1. We can use dynamic loading and fallback to non-precise variation on
      downlevel Windows.

      Note: there is a higher cost associated with precise function. my_hrtime() is used in many places, that may be performance relevant, most notably in pthread_condition_timedwait() Windows port, where it is used twice per pthread_condition_timedwait call. Thus pthread_cond_timedwait, and surrounded code should be reimplemented to use the cheap timer .

      Attachments

        Activity

          wlad Vladislav Vaintroub created issue -
          wlad Vladislav Vaintroub made changes -
          Field Original Value New Value
          Description Currently, we're using GetSystemTimesFileTime for high resolution timers.
          Unfortunately, it is using system timer with accuracy 10ms to 55ms according to https://blogs.msdn.microsoft.com/oldnewthing/20170921-00.

          For system versioning, we need a more accurate timer, this is what GetSystemTimePreciseAsFileTime provides, but this is not available
          prior to Windows 8.1. We can use dynamic loading and fallback to non-precise variation on
          downlevel Windows.

          Note: there is a higher cost associated with precise variation. And hr_time() is used in many places, that maybe performance relevant, most notably in pthread_condition_timedwait() Windows port, where hr_time is used twice per pthread_condition_timedwait call. Thus condition functions, and surrounded code should be reimplemented to use the cheap timer .
          Currently, we're using GetSystemTimesFileTime for high resolution timers.
          Unfortunately, it is using system timer with accuracy 10ms to 55ms according to https://blogs.msdn.microsoft.com/oldnewthing/20170921-00.

          For system versioning, we need a more accurate timer, this is what GetSystemTimePreciseAsFileTime provides, but this is not available
          prior to Windows 8.1. We can use dynamic loading and fallback to non-precise variation on
          downlevel Windows.

          Note: there is a higher cost associated with precise variation. And hr_time() is used in many places, that may be performance relevant, most notably in pthread_condition_timedwait() Windows port, where hr_time is used twice per pthread_condition_timedwait call. Thus condition functions, and surrounded code should be reimplemented to use the cheap timer .
          wlad Vladislav Vaintroub made changes -
          Description Currently, we're using GetSystemTimesFileTime for high resolution timers.
          Unfortunately, it is using system timer with accuracy 10ms to 55ms according to https://blogs.msdn.microsoft.com/oldnewthing/20170921-00.

          For system versioning, we need a more accurate timer, this is what GetSystemTimePreciseAsFileTime provides, but this is not available
          prior to Windows 8.1. We can use dynamic loading and fallback to non-precise variation on
          downlevel Windows.

          Note: there is a higher cost associated with precise variation. And hr_time() is used in many places, that may be performance relevant, most notably in pthread_condition_timedwait() Windows port, where hr_time is used twice per pthread_condition_timedwait call. Thus condition functions, and surrounded code should be reimplemented to use the cheap timer .
          Currently, we're using GetSystemTimesFileTime for high resolution timers.
          Unfortunately, it is using system timer with accuracy 10ms to 55ms according to https://blogs.msdn.microsoft.com/oldnewthing/20170921-00.

          For system versioning, we need a more accurate timer, this is what GetSystemTimePreciseAsFileTime provides, but this is not available
          prior to Windows 8.1. We can use dynamic loading and fallback to non-precise variation on
          downlevel Windows.

          Note: there is a higher cost associated with precise variation. my_hrtime() is used in many places, that may be performance relevant, most notably in pthread_condition_timedwait() Windows port, where it is used twice per pthread_condition_timedwait call. Thus pthread_cond_timedwait, and surrounded code should be reimplemented to use the cheap timer .
          wlad Vladislav Vaintroub made changes -
          Assignee Vladislav Vaintroub [ wlad ]
          wlad Vladislav Vaintroub made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          wlad Vladislav Vaintroub made changes -
          Description Currently, we're using GetSystemTimesFileTime for high resolution timers.
          Unfortunately, it is using system timer with accuracy 10ms to 55ms according to https://blogs.msdn.microsoft.com/oldnewthing/20170921-00.

          For system versioning, we need a more accurate timer, this is what GetSystemTimePreciseAsFileTime provides, but this is not available
          prior to Windows 8.1. We can use dynamic loading and fallback to non-precise variation on
          downlevel Windows.

          Note: there is a higher cost associated with precise variation. my_hrtime() is used in many places, that may be performance relevant, most notably in pthread_condition_timedwait() Windows port, where it is used twice per pthread_condition_timedwait call. Thus pthread_cond_timedwait, and surrounded code should be reimplemented to use the cheap timer .
          Currently, we're using GetSystemTimesFileTime for high resolution timers.
          Unfortunately, it is using system timer with accuracy 10ms to 55ms according to https://blogs.msdn.microsoft.com/oldnewthing/20170921-00.

          For system versioning, we need a more accurate timer, this is what GetSystemTimePreciseAsFileTime provides, but this is not available
          prior to Windows 8.1. We can use dynamic loading and fallback to non-precise variation on
          downlevel Windows.

          Note: there is a higher cost associated with precise function. my_hrtime() is used in many places, that may be performance relevant, most notably in pthread_condition_timedwait() Windows port, where it is used twice per pthread_condition_timedwait call. Thus pthread_cond_timedwait, and surrounded code should be reimplemented to use the cheap timer .
          wlad Vladislav Vaintroub made changes -
          Fix Version/s 10.3.6 [ 23003 ]
          Fix Version/s 10.3 [ 22126 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 86252 ] MariaDB v4 [ 133508 ]

          People

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