Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ha_statistic_increment uses ~5% of CPU on table scan benchmarks #1481

Open
mdcallag opened this issue Aug 5, 2024 · 0 comments
Open

ha_statistic_increment uses ~5% of CPU on table scan benchmarks #1481

mdcallag opened this issue Aug 5, 2024 · 0 comments

Comments

@mdcallag
Copy link
Contributor

mdcallag commented Aug 5, 2024

While running sysbench as explained here with a database that is cached by RocksDB from flamegraphs I see that ha_statistic_increment accounts for about 5% of the samples on the scan microbenchmark on a small server with 1 client connection and a large server with 24 client connections. After editing the function to make it cheaper I get between 5% and 10% more throughput.

The upstream version is here and just increments a per-handler counter.

The MyRocks version is here and does a bit more. The call to check_yield is the most expensive addition. The next most expensive change is the call to update_sql_stats_periodic.

A flamegraph from the small server

sb perf g range-covered-pk pre range100 pk1 all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant