• Sergey Vojtovich's avatar
    MDEV-7999 - PROFILING routines take 0.2% when profiling disabled · 5cfb6b47
    Sergey Vojtovich authored
    PROFILING::start_new_query() optimizations:
    - no need to check "current": added assertion instead
    - "enabled" now means "is enabled currently" instead of "was enabled at query
      start". Old meaning was useless, new meaning echoes OPTION_PROFILING so
      that start_new_query() can be defined in sql_profile.h.
    - remnants of start_new_query() moved to sql_profile.h so it can be inlined
    
    PROFILING::start_new_query() overhead dropped 0.08% -> out of radar.
    
    PROFILING::set_query_source() optimizations:
    - no need to check "enabled": !enabled && current is impossible
    - remnants of set_query_source() moved to sql_profile.h so it can be inlined
    
    PROFILING::set_query_source() overhead dropped 0.02% -> out of radar.
    
    PROFILING::finish_current_query() optimizations:
    - moved "current" check out to sql_profile.h so it can be inlined
    
    PROFILING::finish_current_query() overhead dropped 0.10% -> out of radar.
    5cfb6b47
sql_profile.h 7.37 KB