Cache env and param pointers in InPlaceExecutionContext#462
Open
stanbot8 wants to merge 1 commit intoBioDynaMo:masterfrom
Open
Cache env and param pointers in InPlaceExecutionContext#462stanbot8 wants to merge 1 commit intoBioDynaMo:masterfrom
stanbot8 wants to merge 1 commit intoBioDynaMo:masterfrom
Conversation
2 tasks
Contributor
|
Hi @stanbot8, Thanks for the contribution! I’ll review the changes and get back to you. In the meantime: the CI issue that previously prevented Could you please update your PR branch with the latest |
ef5e85f to
a960c6c
Compare
Execute() called Simulation::GetActive()->GetEnvironment() and GetParam() for every agent every step. These pointers are stable within an agent-ops phase, so cache them once in SetupAgentOpsAll and reuse the cached values in Execute. Eliminates two pointer chases per agent per step.
a960c6c to
6b7632e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Environment*andParam*pointers once per agent-ops phase inSetupAgentOpsAll, eliminating twoSimulation::GetActive()lookups per agent per iteration inExecuteSimulation::GetActive()when cached pointers are null (e.g. whenExecuteis called outside the agent-ops phase, as inCopyExecutionContext)Test plan
make check)Simulation::GetActive()calls inExecuteare eliminated during normal iteration