C++: Improve performance of Printf::callsVariadicFormatter.#9399
Conversation
MathiasVP
left a comment
There was a problem hiding this comment.
As far as I can see, the join_rhs materialization is now gone because we're starting the pipeline with a join between Printf::variadicFormatter and getTarget, and only then do we look at the arguments/parameter pairs. That's indeed a much better join order than what we did before.
There's a lot going on in that pipeline, so I can't immediately see if this is the right way to enforce this join order, but if DCA is happy it's a clear win.
I was expecting to have to try pragmas in a few different places, such as tightly around just I've started the DCA run (after a bit of a fiddle). |
And that's exactly what ended up happening after your change, so that's excellent! Note that the safest way to enforce a join to be first in the pipeline is to unbind all its columns (this pattern is also mentioned in the join order document). It works in this case because the optimizer picked an ordering that only joined on the first column (which you correctly pragma'd), but it could in theory also start with some of the other conjuncts and end off joining on the recursive case using a combination of the last three columns. So if you unbind those three columns as well you avoid this potential issue. |
Noted. My instinct at present is to prefer a minimal intervention (as few In any case this is approved and working and not worth spending hours on, so I'm merging it. |
I can't think of a case off the top of my head, no. |
Improve performance of
cpp/cleartext-storage-buffer, which regressed a month or so ago. The difference isn't huge, though the fix is in library code so it could affect other queries as well.Locally on
wireshark(with cache warmed up bycpp/system-data-exposure) this change improves performance from 55s -> 45s. It appears to have eliminated entirely the following pre-computation:seemingly without affecting the recusion - before:
after:
Confirmed on
kamailio103s -> 96s. I'll do a DCA run as well to check nothing is impacted negatively...