← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 7819ddb: MDEV-8192 - THD::set_command() takes 0.05% in OLTP RO


Hi Sergei,

On Thu, May 28, 2015 at 06:06:45PM +0200, Sergei Golubchik wrote:
> Hi, Sergey!
> On May 20, svoj@xxxxxxxxxxx wrote:
> > revision-id: 7819ddb99be5dff26c8a2109ba70a54289a950ad
> > parent(s): fcb48ee418959ea2c05d528266bb2dcad5bce46b
> > committer: Sergey Vojtovich
> > branch nick: mariadb
> > timestamp: 2015-05-20 16:55:20 +0400
> > message:
> > 
> > MDEV-8192 - THD::set_command() takes 0.05% in OLTP RO
> > 
> > Moved THD::set_command() definition to sql_class.h so that it can be inlined.
> ok
> > Call PSI_server::set_thread_command() conditionally: it is cheaper than calling
> > dummy function when PFS is off (though it adds some overhead when PFS is on).
> I'm not sure about it. P_S will be used more and more over time, let's
> not intentionally penalize it.
A few arguments:
- According to perf overhead of all these *_noop() on the calle side is ~0.5%.
  There's also caller overhead and some inlined functions that do if (psi).
  IMHO that's a bit too much for disabled PFS.
- This newly added overhead is nothing compared to overhead PFS has now.
- When one enables profiling he should accept some added overhead.
  When one disables profiling he may expect no profiling overhead (ideally).

But in fact I don't like this compromise either. There're two good alternatives
on my mind, both are probably quite complex:
- package optimized mysqld (no PFS, no profiling, etc)
- optimize PFS, e.g. PSI_server::set_thread_command() duplicates work of
  THD::set_command() so we may try to reuse effect of the latter

Just let me know if you still don't like this so that I can push at least part
of this patch that we agreed upon.


Follow ups