-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: Work around gimli re-parsing Abbreviations (#683)
Abbreviations in the debug_abbrev section can be, and often are, shared between compilation units. However, the upstream `gimli::Unit::new` eagerly parses and allocates `Abbreviations` for each `Unit`. We have a pathological case where an extremely large 5.5G DWARF file with ~280k compilation units and ~1500 Abbreviations is taking a very long time to process and is holding on to an unreasonable amount of memory while doing so. Profiling suggests a majority of time and memory is spent parsing and dropping these Abbreviations. This workaround copies the `gimli::Unit::new` code to avoid parsing `Abbreviations` at offset 0. In the pathological case mentioned above, *all* the compilation units share the same list of `Abbreviations` at offset 0. Runtime of symcache conversion for the mentioned pathological case goes from 13 minutes down to slightly over 1 minute, and peak memory usage from 18G down to 8G. Not great, not terrible, but a huge improvement nonetheless.
- Loading branch information
Showing
2 changed files
with
178 additions
and
10 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
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