Conversation
This speeds up `Object::Structure Object::summarizeStructure() const` in pathological cases such as #16745 by quite a bit: 37s down to 31s to run. Also removing unused function, `topLevelSubObjectNames()`
msooseth
force-pushed
the
use_boost_unordered_set_for_object
branch
from
September 14, 2026 12:30
a209f77 to
b3235c1
Compare
unordered_flat_set to speed up pathological compile time
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.
Description
This speeds up
Object::Structure Object::summarizeStructure() constin pathological cases such as #16745 by quite a bit: 39s down to 28.3s to run.Also removing unused function,
topLevelSubObjectNames()The only tricky part is that
unordered_flat_setpotentially invalidates iterators when insert/emplace-ing. This is not the case withstd::set.Performance before these changes on #16745 :
Performance after these changes:
Note that I can't just use
util::unordered_flat_set<std::string>, the hash function really makes a difference, since the strings are long. I am also constructing the string first and then checking, this way we don't generate them twice.Note that I can't use
std::string constbecause then thestd::moveis not effective. This way it's faster (by about 1.5s).Checklist
AI Disclosure