summaryrefslogtreecommitdiff
path: root/storage/perfschema/unittest
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-05-06 22:30:35 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-05-10 07:56:55 +0300
commit06442e3e9f7819a982eb7a4dc865be02c556ab06 (patch)
tree8cc76a061d729b988799e8d0706cde3d9c2c159f /storage/perfschema/unittest
parentd0ee3b5500cdaf3382fc8f26c883f45d8f4bdf5b (diff)
downloadmariadb-git-06442e3e9f7819a982eb7a4dc865be02c556ab06.tar.gz
MDEV-19399 do not call slow my_timer_init() several times
No functional change. Call my_timer_init() only once and then reuse it from InnoDB and perfschema storage engines. This patch speeds up empty test for me like this: ./mtr -mem innodb.kevg,xtradb 1.21s user 0.84s system 34% cpu 5.999 total ./mtr -mem innodb.kevg,xtradb 1.12s user 0.60s system 31% cpu 5.385 total
Diffstat (limited to 'storage/perfschema/unittest')
-rw-r--r--storage/perfschema/unittest/pfs_server_stubs.cc2
-rw-r--r--storage/perfschema/unittest/pfs_timer-t.cc2
2 files changed, 4 insertions, 0 deletions
diff --git a/storage/perfschema/unittest/pfs_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc
index d7154067fc2..1093b6a859b 100644
--- a/storage/perfschema/unittest/pfs_server_stubs.cc
+++ b/storage/perfschema/unittest/pfs_server_stubs.cc
@@ -43,3 +43,5 @@ enum sys_var::where get_sys_var_value_origin(void *ptr)
{
return sys_var::AUTO;
}
+
+MY_TIMER_INFO sys_timer_info;
diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc
index 55113860532..f2752191447 100644
--- a/storage/perfschema/unittest/pfs_timer-t.cc
+++ b/storage/perfschema/unittest/pfs_timer-t.cc
@@ -33,6 +33,8 @@ void test_timers()
ulonglong t4_b;
ulonglong t5_b;
+ my_timer_init(&sys_timer_info);
+
init_timers();
t1_a= get_timer_pico_value(TIMER_NAME_CYCLE);