In helping MicroBooNE with optimizing one their workflows, I stumbled across a nested for loop where many searches were being unnecessarily done in an inner loop, when it is sufficient to do them once in an outer loop. For example, map_imp_ch[abs_pbin] is being invoked during each iteration of the tbin loop, when it is only necessary in the outer pbin loop.
The changes in this pull request move the outer-loop searches to only the outer loop, resulting in a 10% improvement for the total CPU time it takes to run the MicroBooNE WireCell detsim job. I'm happy to provide the profile information if you like.
In helping MicroBooNE with optimizing one their workflows, I stumbled across a nested
for
loop where many searches were being unnecessarily done in an inner loop, when it is sufficient to do them once in an outer loop. For example,map_imp_ch[abs_pbin]
is being invoked during each iteration of thetbin
loop, when it is only necessary in the outerpbin
loop.The changes in this pull request move the outer-loop searches to only the outer loop, resulting in a 10% improvement for the total CPU time it takes to run the MicroBooNE WireCell detsim job. I'm happy to provide the profile information if you like.
Cheers, Kyle