-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap the state to navigate the problem space of `remove_finished_glob…
…als` into a `struct` and again into a `std::shared_ptr`. Profile shows that the majority of the CPU time is spent in construction and destruction of the tree (`GoalSet` --> `std::set<..>`), which is mostly caused when doing `queue.pop_front();`. but if we put this data in a shared_ptr instead, we won't delete it immediately, and the heap allocated data will be reused in the case of continue statements, that just puts back the state into the queue without any modification. This change is something that has no downside but has only upsides. Possibly there would be a cleverer fix that would make the internal data more reusable in case of the state-branching within the for loop, but this is an improvement which would be helpful with a quicker fix. PiperOrigin-RevId: 704637937
- Loading branch information
1 parent
4047709
commit 04da15e
Showing
1 changed file
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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