RFR 8221623 : Add StackWalker micro benchmarks to jdk repo

Daniel Fuchs daniel.fuchs at oracle.com
Mon Sep 23 09:15:36 UTC 2019


Hi Brent,

On 19/09/2019 20:08, Brent Christian wrote:
> Well-spotted.
> JMH defaults to using 1 worker thread, but can be configured to use 
> more.  I tried with '-t max' (8 threads on my machine), and the 
> benchmark NPE'd, as you predicted.
> 
> I've updated the benchmark to use a separate handler (and Logger) 
> per-thread, and it can now run w/ '-t max'.  Single-thread scores are 
> within a few % of the original test.  I also added "Logging" to the 
> benchmark names to make it easier to select both in JMH using a simple 
> regex.

Good. Thanks for checking!

> http://cr.openjdk.java.net/~bchristi/8221623/webrev09-loggerPerThread/

The updated benchmark looks good to me.
I almost missed the magic at line 47:
   47     @State(value = Scope.Thread) // create a separate one for each 
worker thread
I'll try to remember that trick.

> Though really, since logging is no longer using Throwable to examine the 
> call stack, maybe it makes more sense to move the logging benchmarks to 
> their own file under:
> 
> test/micro/org/openjdk/bench/java/util/logging/

Well, I'll let you decide on that. That would be the first
logging benchmark :-)

best regards,

-- daniel



More information about the core-libs-dev mailing list