Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JITLink][NFC] Store external symbols in a StringMap
External symbols used to be stored in a `DenseSet`. An `assert` in `addExternalSymbol` ensures that names of external symbols are unique. However, for objects containing a huge number of external symbols, this `assert` can be a performance bottleneck. This patch proposes to store external symbols in a `StringMap` instead making it significantly cheaper to check if a certain symbol name already exists. This issue came up while porting BOLT to JITLink (D147544): linking a large binary using the JITLink port turned out to be about 4x slower than the current version of BOLT that uses RuntimeDyld. This slowdown was caused entirely by the `assert` in `addExternalSymbol`. Using this patch, the JITLink port is slightly faster than RuntimeDyld. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D150874
- Loading branch information
Showing
1 changed file
with
32 additions
and
21 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