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

VolumeManager: prevent duplicated add_entry call #1307

Closed
wants to merge 1 commit into from

Conversation

Zehvogel
Copy link
Contributor

@Zehvogel Zehvogel commented Aug 6, 2024

As far as I understand we only want to call add_entry once per cellID. If we call it more than once nothing happens because we guard against that with the m_entries set. However, currently we call it many additional times, in the worst case twice for every module. Just not doing this seems to reduce the overall initialization time of the VolumeManager by ~20% in our case (CLD).

For example when initially called in populate() on a generic tracking detector like DD4hep_SiTrackerBarrel the following happens:

  • The recursion steps all the way down to iterate over the components of a module (slices of material of the chip)
  • add_entry is called successfully for the sensitive silicon layer with the cellID
  • after the iteration over the components is finished, add_entry is called for the module with the ID of the silicon layer
  • add_entry call does nothing as that cellID is already in the m_entries set.
  • an additional useless add_entry call is also performed at every other step up in the recursion (stave, layer, side)...

This PR should get rid of these cases, without causing any other behavioural changes.

BEGINRELEASENOTES

  • Thank you for writing the text to appear in the release notes. It will show up
    exactly as it appears between the two bold lines
  • ...

ENDRELEASENOTES

@Zehvogel
Copy link
Contributor Author

Zehvogel commented Aug 6, 2024

Ok, given the tests results I did miss something 😞

Copy link

github-actions bot commented Aug 6, 2024

Test Results

   14 files     14 suites   8h 15m 31s ⏱️
  365 tests   332 ✅ 0 💤  33 ❌
2 510 runs  2 393 ✅ 0 💤 117 ❌

For more details on these failures, see this check.

Results for commit 07ad342.

@Zehvogel
Copy link
Contributor Author

Zehvogel commented Aug 6, 2024

The speed-up also only appears in Debug and not Release builds on my machine so I am giving up on this for now

@andresailer andresailer closed this Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants