On Fri, 19 Aug 2022 18:48:10 GMT, Eric Caspole <ecasp...@openjdk.org> wrote:

> Add a JMH for ProtectionDomain related to current work on JDK-8292375. Also, 
> add the InMemoryJavaCompiler to the JMH jar, to generate the classes needed 
> for this test and will be useful for future class loading JMH too.

test/micro/org/openjdk/bench/java/security/ProtectionDomainBench.java line 49:

> 47: @OutputTimeUnit(TimeUnit.MILLISECONDS)
> 48: @Warmup(iterations = 15)
> 49: @Measurement(iterations = 15)

Given the recent work to reduce microbenchmark runtimes, does this actually 
need this many iterations and time to get a stable microbenchmark?

test/micro/org/openjdk/bench/java/security/ProtectionDomainBench.java line 73:

> 71:                 + "       intField++;"
> 72:                 + "   }"
> 73:                 + "}");

Curious why copying to new String? Is this to try to avoid string 
deduplication? Could it be simplified?

Suggestion:

        return "public class B" + count + " {"
                + "   static int intField;"
                + "   public static void compiledMethod() { "
                + "       intField++;"
                + "   }"
                + "}";

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

PR: https://git.openjdk.org/jdk/pull/9950

Reply via email to