Skip to content

AthConfigFlags: add cache for hasCategory

Frank Winklmeier requested to merge fwinkl/athena:hascategory_speedup into 23.0

The lookup of flags categories can be very slow for jobs with many flags due to the loop over all flag names and comparison using startswith. Add a cache for already found categories. In principle it would be better to store the flags in a "trie" data-structure but that would require more work (or a 3rd-party library).

Also minor optimization for set and get to avoid duplicate lookups in flags dictionary and streamline error message code.

cc @wlampl @tbold

Edited by Frank Winklmeier

Merge request reports