RFR: 8256507: Add a micro benchmark for JDK-8153005

Aleksey Shipilev shade at openjdk.java.net
Wed Nov 18 13:53:06 UTC 2020


On Tue, 17 Nov 2020 21:46:38 GMT, Weijun Wang <weijun at openjdk.org> wrote:

> This is a micro benchmark for various algorithm settings of PKCS keystores. Strong for new algorithms and weak for old ones. Different iteration counts are tried. The result should show that the current setting (strong10000) is more efficient than old setting (weak50000).

I think the benchmark can be simplified.

test/micro/org/openjdk/bench/java/security/PKCS12KeyStores.java line 65:

> 63:     }
> 64: 
> 65:     static {

Move these to 

@Setup
public void setup() throws Exception {
  ...
}

This would save you a `try-catch` section, and harness would properly fail on setup exception.

test/micro/org/openjdk/bench/java/security/PKCS12KeyStores.java line 137:

> 135:                 "PBEWithSHA1AndDESede", "2048",
> 136:                 "HmacPBESHA1", "2048");
> 137:     }

Any reason why these methods are not inlined into `@Benchmark` methods right away? E.g. why it is not:

    @Benchmark
    public byte[] outweak2048() throws Exception {
        return out("PBEWithSHA1AndRC2_40", "2048",
                "PBEWithSHA1AndDESede", "2048",
                "HmacPBESHA1", "2048");
    }

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

Changes requested by shade (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/1277


More information about the security-dev mailing list