Reduce number of calls to HLT::Identifier::name() (ATR-27539)
Often we are creating temporary HLT::Identifier objects (string2hash), then calling name(), which uses hash2string. This contributes to the surprisingly high ComboHypo cost (~2% of the HLT time, according to cost monitoring).
I had to make the HLT::Identifier(const std::string&)
constructor explicit because otherwise the calls
foo(Identifier) {
return foo(Identifier.name());
}
were causing infinite loops, since they ended up calling themselves.
Additionally, apply a strange but fast idiom for checking the start of a string (in C++20 this can be replaced with starts_with). cc @abarton @averbyts
This should also improve MT performance since hash2string calls use a tbb::concurrent_hash_map, with a lock.