Skip to content

Performance issue related to BitFieldCoder::get #27

@vvolkl

Description

@vvolkl

As reported by Nicolas Morange:

All calls related to getting the position of a cell use a DDSegmentation::BitFieldCoder object. The problem is, the function used absolutely everywhere is this one: long64 get(long64 bitfield, const std::string& name) const which does a std::map::find(name) instead of retrieving the index only once and using long64 get(long64 bitfield, size_t idx) const As this behaviour is in many very basic classes in DD4Hep::DDSegmentation and in FCCDetectors::DetSegmentation, it is used in many hot loops, and so this std::map::find amounts to 15% of the total CPU spent in my jobs... A priori the fix is simple, i.e get the indices from the strings in the initialization of the algorithms/tools, and then use the correct function.

Screenshot_20220629_181656(1)
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions