RFR: 8334866: Improve Speed of ElfDecoder source search [v8]

Christian Hagedorn chagedorn at openjdk.org
Thu Oct 30 11:46:19 UTC 2025


On Thu, 30 Oct 2025 11:43:06 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.
>
> Kerem Kat has updated the pull request incrementally with three additional commits since the last revision:
> 
>  - Revert "Erase obsolete comments"
>    
>    This reverts commit 860b6ee6faeb6e56e292abef1c85faad456729e2.
>  - fix space
>  - Erase obsolete comments

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java line 52:

> 50:   public WindbgOopHandle readOopHandle(long address) throws DebuggerException;
> 51:   public WindbgOopHandle readCompOopHandle(long address) throws DebuggerException;
> 52: 

This commit just happened while I reviewed the old state. Can you explain why you want to squeeze this and the cleanup below in here? It does not seem to be related to improving the DWARF parser. If it's unrelated, you could still clean it up but might be better done separately.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27337#discussion_r2477724273


More information about the hotspot-dev mailing list