WireCell / wire-cell-gen

Wire Cell packages that can generate things like wires, cells, depositions, diffusions, slices, frames, ...
0 stars 1 forks source link

Optimizations for BinnedDiffusion #31

Closed knoepfel closed 5 years ago

knoepfel commented 5 years ago

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.

Cheers, Kyle