1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Optimize performance schema likely/unlikely

Performance schema likely/unlikely assume that performance schema
is enabled by default, which causes a performance degradation for
default installations that doesn't have performance schema enabled.

Fixed by changing the likely/unlikely in PS to assume it's
not enabled. This can be changed by compiling with
-DPSI_ON_BY_DEFAULT

Other changes:
- Added psi_likely/psi_unlikely that is depending on
  PSI_ON_BY_DEFAULT. psi_likely() is assumed to be true
  if PS is enabled.
- Added likely/unlikely to some PS interface code.
- Moved pfs_enabled to mysys (was initialized but not used before)
- Added "if (pfs_likely(pfs_enabled))" around calls to PS to avoid
  an extra call if PS is not enabled.
- Moved checking flag_global_instrumention before other flags
  to speed up the case when PS is not enabled.
This commit is contained in:
Michael Widenius
2018-04-17 00:08:03 +03:00
committed by Monty
parent 9d6dc39ad9
commit 70c1110a29
14 changed files with 486 additions and 401 deletions

View File

@@ -82,7 +82,7 @@ inline_mysql_start_idle_wait(PSI_idle_locker_state *state,
static inline void
inline_mysql_end_idle_wait(struct PSI_idle_locker *locker)
{
if (likely(locker != NULL))
if (psi_likely(locker != NULL))
PSI_IDLE_CALL(end_idle_wait)(locker);
}
#endif