Skip to content

TriggerMenuMT: Small python optimisations

Rafal Bielski requested to merge rbielski/athena:tmmt-speed-up into master

Three small python optimisations which together shave off a few seconds from the menu configuration time. Inspired by cProfile results posted in ATR-23767. The effect isn't significant enough to help there, but large enough to make this MR worthwhile.

The changes (separate commits):

  • HLTCFConfig.py: Avoid looping over the same list of dicts millions of times
  • HLTMenuJSON.py: Optimise the search for chain name in filter configuration
  • Move imports to the top of the file in a few modules. Normally this doesn't matter, but in some of these cases the import was called in a deeply nested loop and enough times to make the total time measurable. This MR reduces the number of import calls in the job by around 4% (100k).

Merge request reports