RFR: 8334866: Improve Speed of ElfDecoder source search [v4]
Kerem Kat
krk at openjdk.org
Tue Oct 21 16:31:48 UTC 2025
> Right now, looking up source file and line number info is slow because we do a full linear scan of the `.debug_aranges` section for every single call. This can be a major bottleneck on large binaries, especially during frequent native stack walking, e.g. while writing an hs_err.
>
> This change fixes that by caching the address ranges on the first lookup, and keeping it in memory for the lifetime of the `DwarfFile` object.
>
> All subsequent lookups on that object now use a binary search instead of the slow linear scan. If caching fails for any reason, it just falls back to the old method.
Kerem Kat has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
- Merge branch 'master' into elfdecoder-JDK-8334866
- Merge remote-tracking branch 'upstream/master' into elfdecoder-JDK-8334866
- Merge remote-tracking branch 'upstream/master' into elfdecoder-JDK-8334866
- 8334866: Cache debug_aranges for faster address lookups
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27337/files
- new: https://git.openjdk.org/jdk/pull/27337/files/fe32a078..623870ee
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27337&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27337&range=02-03
Stats: 25938 lines in 681 files changed: 14672 ins; 8044 del; 3222 mod
Patch: https://git.openjdk.org/jdk/pull/27337.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27337/head:pull/27337
PR: https://git.openjdk.org/jdk/pull/27337
More information about the hotspot-dev
mailing list