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

Brent Christian brent.christian at oracle.com
Wed May 18 18:24:23 UTC 2016


Hi,

I compared 8u65 and 9b116 performance on a simple 
Throwable.getStackTrace() JMH benchmark that I have, using a variety of 
call stack depths.  Performance looks very similar between the two; if 
anything, 9b116 has a slight edge for larger stack depths.

So I don't think the difference is due to the walking of the stack 
itself, at least based on what I measured.

HTH,
-Brent

On 5/10/16 9:49 AM, Ralph Goers wrote:
> I just ran one of the Log4j performance tests that specifically captures location information.  To run the test I do
>
> java -jar log4j-perf/target/benchmarks.jar ".*AsyncAppenderLog4j2LocationBenchmark.*" -f 1 -wi 10 -i 20 -t 4 -si true
>
> And the results are:
>
> java version "1.7.0_80
>
> Benchmark                                                             Mode  Samples       Score      Error  Units
> o.a.l.l.p.j.AsyncAppenderLog4j2LocationBenchmark.throughputSimple    thrpt       20  124819.285 ± 3003.918  ops/s
>
> java version "1.8.0_65"
>
> Benchmark                                                             Mode  Samples       Score      Error  Units
> o.a.l.l.p.j.AsyncAppenderLog4j2LocationBenchmark.throughputSimple    thrpt       20  123209.746 ± 3064.672  ops/s
>
>
> java version "9-ea"
> Java(TM) SE Runtime Environment (build 9-ea+116)
>
> Benchmark                                                             Mode  Samples      Score      Error  Units
> o.a.l.l.p.j.AsyncAppenderLog4j2LocationBenchmark.throughputSimple    thrpt       20  96090.261 ± 4565.763  ops/s
>
>
> This tells me that Java 9 is about 23% slower than previous versions in walking the stack trace elements.
>
> Ralph



More information about the core-libs-dev mailing list