Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11
-
None
-
Related to performance
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);
|