RFR: 8373096: JFR: Path-to-gc-roots search should be non-recursive [v6]
Thomas Stuefe
stuefe at openjdk.org
Thu Feb 5 10:44:58 UTC 2026
On Thu, 5 Feb 2026 10:27:19 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> > I wonder if you have looked at performance. For example, in which order is it best to check for nullptr, oop has been visited or whether the stack is full? You added a _num_objects_processed variable, but it’s never used, so you might want to remove it.
>
> It is better to check if the stack is full first. 10 mio references take (median user CPU time) about 10.7 seconds with mark bit search first, 9.7 seconds with stack fullness check first. That makes sense since the stack fullness check is just comparing two integers, whereas the markbit query is more involved.
And note that the new solution is faster than the old recursive one, which takes about 11.5 seconds user CPU time on my machine.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29382#issuecomment-3852705760
More information about the hotspot-jfr-dev
mailing list