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
speedup: switch EgammaTools EnergyScaleCorrection scales and smearings to use std::map #32053
speedup: switch EgammaTools EnergyScaleCorrection scales and smearings to use std::map #32053
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32053/19646
|
A new Pull Request was created by @slava77 (Slava Krutelyov) for master. It involves the following packages: RecoEgamma/EgammaTools @perrotta, @jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild please test |
The tests are being triggered in jenkins.
|
+1 |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
@bainbrid |
+1 |
@Sam-Harper @shervin86 |
curiously, the earlier version in #22308 used std::map cmssw/EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h Lines 204 to 205 in 7a27eab
|
so the standard vector should be faster in the event loop, I understand though its slow at the start though. It could probably be fixed to be made faster in the event loop. Its also got significantly slower since it was first written due to many more categories being used. It may be well we improve this in the future but I think that shouldn't stop improvements now. |
…caleCorrection speedup: switch EgammaTools EnergyScaleCorrection scales and smearings to use std::map (backport of #32053)
the technical regression became more obvious after a recent update in the scale/smearing introduced in #31936. E.g. the start time of a 2018 UL re-miniAOD workflow 136.88811 went up to about 10 mins.
Apparently the EnergyScaleCorrection used an equivalent of a std::map implemented via a vector with repeated calls to sort during insertion, which lead to the startup time explosion
job start time for wf a 2018 UL re-miniAOD workflow 136.88811 went down by about a factor of 10
from https://slava77sk.web.cern.ch/slava77sk/reco/cgi-bin/igprof-navigator/CMSSW_11_2_X_2020-11-04-1100-orig.136.88811.step2.1.pp/9
to https://slava77sk.web.cern.ch/slava77sk/reco/cgi-bin/igprof-navigator/CMSSW_11_2_X_2020-11-04-1100-sign1111.136.88811.step2.1.pp/26
(the profile links are for 1 event processed).
the time cost of calling
EnergyScaleCorrection::addScale
went down by almost 4 orders of magnitudehttps://slava77sk.web.cern.ch/slava77sk/reco/cgi-bin/igprof-navigator/CMSSW_11_2_X_2020-11-04-1100-orig.136.88811.step2.1.pp/21 =>
https://slava77sk.web.cern.ch/slava77sk/reco/cgi-bin/igprof-navigator/CMSSW_11_2_X_2020-11-04-1100-sign1111.136.88811.step2.1.pp/1011