Skip to content

Perform BX map decoding on the fly

Dinyar Rabady requested to merge chore/refactoring_and_optimisations into master

This MR belongs to #35 (closed), essentially I noticed during profiling that we spend an exorbitant amount of time decoding the BX mask (some more details in the issue itself).

After this MR the fraction spent on BX mask decoding goes down significantly. I ran it through the CI and at B40, but haven't checked if the output makes sense. @tjames, could you maybe test it at B40 and create your plots for validation?

One thing to mention: There is a left over nagging question in my mind: In the last commit I replace

uint32_t bxcount = std::max(mAcount,mBcount);
if (bxcount == 0) { ... }

with

if (mAcount + mBcount == 0) { ... }

which in profiling seems to have reduced the time we spend in the function retrieving the BX trailer. This doesn't really make sense to me, but maybe something changed on the machine in between profiling sessions. I'll repeat the measurements a bit later today to make sure, but would appreciate reviews already now.

Cheers, Dinyar

Profiling graphs:

Muons originally: Screenshot_from_2022-11-07_12-44-55

vs. muons after BX map decoding improvements: Screenshot_from_2022-11-07_13-34-16

vs. muons after std::max remplacement: Screenshot_from_2022-11-07_13-34-33

Calo originally: Screenshot_from_2022-11-07_12-44-13

vs. calo after BX map decoding improvements: Screenshot_from_2022-11-07_13-33-58

Merge request reports