The PERFORMANCE_SCHEMA wrapper for mutex and rw-lock operations is causing a lot of unlikely code to be inlined in each invocation. The impact of this may have been emphasized in MariaDB 10.6, because InnoDB now uses the common implementation of mutexes and condition variables (
By default, we build with cmake -DPLUGIN_PERFSCHEMA enabled, but at runtime no instrumentation will be enabled. Similar to
MDEV-22721, we’d better avoid inlining the rarely executed code in order to reduce the code size and to improve the efficiency of the instruction cache.