Integrated: 8334866: Improve Speed of ElfDecoder source search
Kerem Kat
krk at openjdk.org
Wed Nov 5 08:36:30 UTC 2025
On Wed, 17 Sep 2025 10:14:09 GMT, Kerem Kat <krk at openjdk.org> wrote:
> 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.
This pull request has now been integrated.
Changeset: dddfcd03
Author: Kerem Kat <krk at openjdk.org>
Committer: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/dddfcd03aa30514d63eceff707d48bff35e93c56
Stats: 229 lines in 2 files changed: 216 ins; 4 del; 9 mod
8334866: Improve Speed of ElfDecoder source search
Reviewed-by: shade, chagedorn
-------------
PR: https://git.openjdk.org/jdk/pull/27337
More information about the hotspot-dev
mailing list