Review request 8153912: StackFrame::getFileName and StackFrame::getLineNumber not needed

Daniel Fuchs daniel.fuchs at
Mon Mar 13 19:04:19 UTC 2017

Hi Ralph,

I see one issue in your benchmark:

StackWalker walker = 

will return a new StackWalker every time it's called.
I'd suggest to create the StackWalker only once and put it in
a private (or package) static.
This will eliminate the creation cost of StackWalker from the

On 13/03/2017 18:52, Ralph Goers wrote:
> The “search” that uses StackWalker probably walks it to the end because
> I had to use test() to determine the StackFrame to return. If you can
> provide a better algorithm to use I’d be happy to retest it. If I=0 is
> the current StackFrame, then that is what we do. Please take a look at
> the stackwalkerSearch method
> at

I'm curious as to why using reduce() as opposed to findFirst().
Won't reduce() continue to walk the stack even when the searched
frame is found?

best regards,

-- daniel

More information about the core-libs-dev mailing list