RFR: 8334866: Improve Speed of ElfDecoder source search [v6]
Kerem Kat
krk at openjdk.org
Fri Oct 24 17:38:35 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 incrementally with one additional commit since the last revision:
Fix comments, delete copy ctor
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27337/files
- new: https://git.openjdk.org/jdk/pull/27337/files/ae72cae8..316f6316
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27337&range=05
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27337&range=04-05
Stats: 7 lines in 2 files changed: 2 ins; 3 del; 2 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