Skip to content

Commit 046f05a

Browse files
committed
Bug#12346211 - PERF IMPACT OF PERFORMANCE-SCHEMA WITH DISABLED INSTRUMENTS/CONSUMERS
This changeset implement various performance improvements implemented to date. Major change: The instrumentation of table io and table lock has been re factored, to avoid performing excessive CPU computation when a table is reused in the table open cache. The statistics (1) by calling thread and (2) by object are collected in a more disjoint way, avoiding the need to aggregate stats per table share in (2) every time the thread using the table changes in (1). See the updated doxygen documentation for table_locker. Minor changes: Performance schema memory structures and critical global variables are not aligned on 128 bytes boundaries, to avoid false sharing between CPU cache lines, and to avoid using more cache lines than necessary. Every LF_HASH table is sized to the maximum when the hash is created, to avoid having to resize dynamically the LF_HASH when new elements are inserted. The size and load count of every LF_HASH table is now displayed in the output of SHOW ENGINE PERFORMANCE_SCHEMA STATUS, to help diagnostics. The macro PSI_CALL has been replaced by PSI_XXX_CALL for each type of instrumentation. This change is a preliminary cleanup, to make implementing further optimizations possible. Event name indexes for hard coded events (table io, table lock, idle) are now compile time constants, instead of being dynamically allocated. Using constants makes the code simpler and helps the compiler to perform better optimizations.
1 parent 0e6e4a0 commit 046f05a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+833
-594
lines changed

config.h.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@
128128
#cmakedefine FIONREAD_IN_SYS_FILIO 1
129129

130130
/* Functions we may want to use. */
131+
#cmakedefine HAVE_ALIGNED_MALLOC 1
132+
#cmakedefine HAVE_ALIGNED_FREE 1
131133
#cmakedefine HAVE_AIOWAIT 1
132134
#cmakedefine HAVE_ALARM 1
133135
#cmakedefine HAVE_ALLOCA 1
@@ -203,6 +205,7 @@
203205
#cmakedefine HAVE_POLL 1
204206
#cmakedefine HAVE_PORT_CREATE 1
205207
#cmakedefine HAVE_POSIX_FALLOCATE 1
208+
#cmakedefine HAVE_POSIX_MEMALIGN 1
206209
#cmakedefine HAVE_PREAD 1
207210
#cmakedefine HAVE_PAUSE_INSTRUCTION 1
208211
#cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1

configure.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ ENDIF()
372372
#
373373
# Tests for functions
374374
#
375+
CHECK_FUNCTION_EXISTS (_aligned_malloc HAVE_ALIGNED_MALLOC)
376+
CHECK_FUNCTION_EXISTS (_aligned_free HAVE_ALIGNED_FREE)
375377
#CHECK_FUNCTION_EXISTS (aiowait HAVE_AIOWAIT)
376378
CHECK_FUNCTION_EXISTS (aio_read HAVE_AIO_READ)
377379
CHECK_FUNCTION_EXISTS (alarm HAVE_ALARM)
@@ -438,6 +440,7 @@ CHECK_FUNCTION_EXISTS (perror HAVE_PERROR)
438440
CHECK_FUNCTION_EXISTS (poll HAVE_POLL)
439441
CHECK_FUNCTION_EXISTS (port_create HAVE_PORT_CREATE)
440442
CHECK_FUNCTION_EXISTS (posix_fallocate HAVE_POSIX_FALLOCATE)
443+
CHECK_FUNCTION_EXISTS (posix_memalign HAVE_POSIX_MEMALIGN)
441444
CHECK_FUNCTION_EXISTS (pread HAVE_PREAD)
442445
CHECK_FUNCTION_EXISTS (pthread_attr_create HAVE_PTHREAD_ATTR_CREATE)
443446
CHECK_FUNCTION_EXISTS (pthread_attr_getstacksize HAVE_PTHREAD_ATTR_GETSTACKSIZE)

0 commit comments

Comments
 (0)