[MDEV-7945] THD::enter_stage() takes 0.48% in OLTP RO Created: 2015-04-09  Updated: 2015-05-13  Resolved: 2015-05-13

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.1
Fix Version/s: 10.1.5

Type: Bug Priority: Major
Reporter: Sergey Vojtovich Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: None

Epic Link: Performance: micro optimizations

 Description   

Data comes from Sandy Bridge system running sysbench OLTP RO in 1 thread against 1 table.

Call graphs:

-   0.48%  mysqld  mysqld
   - THD::enter_stage(PSI_stage_info_v1 const*, PSI_stage_info_v1*, char const*, char const*, unsigned int)
      + 17.64% JOIN::optimize_inner()
      + 10.74% JOIN::exec_inner()
      + 7.88% mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_
      + 7.39% open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*)
      + 7.30% mysql_lock_tables(THD*, st_mysql_lock*, unsigned int)
      + 5.98% net_after_header_psi(st_net*, void*, unsigned long, char)
      + 5.79% check_access(THD*, unsigned long, char const*, unsigned long*, st_grant_internal_info*, bool, bool)
      + 4.57% JOIN::optimize()
      + 4.22% close_thread_tables(THD*)
      + 4.18% set_thd_proc_info
      + 3.85% mysql_execute_command(THD*)
      + 3.83% JOIN::exec()
      + 3.77% mysql_parse(THD*, char*, unsigned int, Parser_state*)
      + 3.30% dispatch_command(enum_server_command, THD*, char*, unsigned int)
      + 3.09% mysql_unlock_tables(THD*, st_mysql_lock*, bool)
      + 2.77% check_table_access(THD*, unsigned long, TABLE_LIST*, bool, unsigned int, bool)
      + 1.49% my_real_read(st_net*, unsigned long*, char)
      + 0.72% mysql_lock_tables(THD*, TABLE**, unsigned int, unsigned int)

Most of the time is spent calling profiling.status_change(). This may be caused by branch misprediction. Aim of this task is to try to get rid of these branches. Inlining progiling.status_change() will be subject of different task.



 Comments   
Comment by Sergey Vojtovich [ 2015-04-14 ]

serg, please review patch for this task.

Generated at Thu Feb 08 07:23:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.