Skip to content

ComponentAccumulator: optimize mergeSequences

Frank Winklmeier requested to merge fwinkl/athena:CA_mergeSeq into main

The mergeSequences method showed a hotspot in getattr as the code is comparing the properties of all sequences to be merged. Optimize by:

  • only compare the actually set properties rather than all of them
  • use _properties instead of getattr to speed up access

The code deliberately uses [] for dictionary access and catches 'KeyError' instead of using get as the former is faster for the normal case where all keys are available.

This speeds up the (Dev_pp_run3_v1) trigger menu generation by 40 seconds (10%).

Relates to ATR-26582.

cc @tbold

Merge request reports

Loading