Because StringMapEntrys have stable addresses, The IncludeBuckets can be changed to store pointers to entrys instead of the key used for accessing IncludeLocations.
This saves having to lookup the IncludeLocations map as well as creating unnecessary strings.
Details
Details
- Reviewers
LegalizeAdulthood alexfh aaron.ballman
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I wonder what motivated the patch. Is this a performance optimization? If so, do you have any measurements?
Comment Actions
I was doing some work on IncludeInserter and just thought, this seems unnecessary. It'd be hard to microbenchmark this, but I'll see what I can rustle up.
Comment Actions
This change is dangerous, it depends that elements/iterators won't be re-allocated/invalidated during insertion process.
Part with removing double lookup in IncludeSorter::addInclude looks fine, but part that involve IncludeBucket is problematic.
I will try to push part that involve IncludeLocations optimizations.