Skip to content

[ATR-23427] Add option to TriggerDecisionTool to avoid parsing chain groups via regular expression

Tim Martin requested to merge tamartin/athena:tdt_tests into master

The TDT maintains an internal cache of ChainGroups. These are formed from some OR of existing HLT chains and L1 items.

Chain groups are constructible from a vector of patterns which are interpreted as regular expressions.

One common method is to supply a small number (normally 1) regex pattern.

Another method is to supply a large number of patterns, where each pattern is simply a chain name. This is done internally by the TDT to make a pre-defined and aliased chain group for all registered Groups and Streams in the menu.

Due to allowing regex, the update function scales very poorly in this second case. It has to compile and match when a simple string == would suffice, and it is unable to break the nested loop - again due to expecting to be processing regex which could match multiple cases.

This can then take up to 1.5 seconds to compute the large groups, and this is observed to scale poorly with multiple slots in high-MT environments due to memory contention. I measured up to 30 seconds with 16 slots, the above ticket with up to 64 was multiple minutes.

By adding the option to perform a more optimised match for the case where a pure vector of existing items is supplied, this worst-case group reduces from 30 seconds at 16 threads to 3 miliseconds.

EDIT:

With the bugfix of changing the break to a continue, we're up to 50 miliseconds for the worst-case group. Will have to see how this scales at 64 threads.

Edited by Tim Martin

Merge request reports