Excessive and unneccessary current_thd usage in Percona Server
A call to _current_thd() is expensive, and some Percona patches use
current_thd unnecessarily, sometimes on critical code paths.
For example, benchmarks show that removing the following _current_thd()
call in innobase_
high-concurrency results by about 1k tps:
/* Save the current replication position for write to trx sys
header for undo purposes, see the comment at corresponding call
The THD pointer is available in trx->mysql_thd, there's no need to use
A quick inspection of the code shows there are many more unnecessary
current_thd occurrences in our code. Some of them are trivial to fix, while
others may require re-architecting certain features.
- Stewart Smith (community): Approve on 2013-02-20
- Percona Reviewers G2: Pending requested 2013-02-17
Diff: 63 lines (+10/-7)4 files modifiedPercona-Server/sql/filesort.cc (+4/-3)