Skip to content

MET Rebuild Speedup, master branch (2022.08.30.)

Following on from !56272 (merged) and !56339 (merged), this MR aims to speed up MET re-building during analysis a little.

The whole thing started from me noticing the following in the MET code already during the previous code profiling:

image

Most of the time in the met::METMaker::rebuildJetMet function is spent with constructing ElementLink-s. Which made sense, since a lot of them would be created by this function, in a pretty inefficient way.

To handle this, I had to first introduce 2 new functions into asg::AsgTool. These are meant to allow (even other) analysis tools to optimise parts of their code that need to create a lot of element links.

Then I added a bunch of code for testing those 2 new functions. (I know this is how things should go in general, but it's still super painful to write hundreds of lines of code for testing about 10 new lines of actual code.) Doing a tiny bit of maintenance on the AsgExampleTools package along the way.

Finally, I updated METMaker.cxx to take advantage of the new functionality in asg::AsgTool.

With all this added, the same job that produced the profile above, was modified to look like this:

image

...with ElementLink creation becoming a small part of the time spent in that function.

Pinging @khoo. Please pull in any expert that would need to look at this to make sure that I didn't break anything. But since some of these changes are not trivial, I'm using full-unit-tests as well. 😉

Edited by Attila Krasznahorkay

Merge request reports