Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue related to BitFieldCoder::get #27

Open
vvolkl opened this issue Jul 1, 2022 · 0 comments
Open

Performance issue related to BitFieldCoder::get #27

vvolkl opened this issue Jul 1, 2022 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@vvolkl
Copy link
Member

vvolkl commented Jul 1, 2022

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)
.

@vvolkl vvolkl added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant