Class AbstractTraceCryptoBenchmarkTest

java.lang.Object
io.jans.lock.trace.crypto.bc.testkit.AbstractTraceCryptoBenchmarkTest

public abstract class AbstractTraceCryptoBenchmarkTest extends Object
Multi-threaded throughput benchmark of a TraceCryptoProvider. A subclass supplies the provider; the workload, the thread pool, the measurement and the report live here, so the JAVA and NATIVE runs are measured the same way.

Every operation runs in a tight loop on several threads sharing one provider, one key and one record. A warm-up phase precedes the measured phase. The report gives the throughput, the mean latency and the p50/p95/p99/max latency, and is printed and appended to target/trace-crypto-bench.csv.

The benchmark is opt-in so it does not slow regular builds. Run it with -Dtrace.bench=true. Tuning, all optional:

  • -Dtrace.bench.threads=4 worker threads
  • -Dtrace.bench.warmupMs=2000 warm-up time per operation
  • -Dtrace.bench.durationMs=5000 measured time per operation
  • Constructor Details

    • AbstractTraceCryptoBenchmarkTest

      public AbstractTraceCryptoBenchmarkTest()
  • Method Details

    • createProvider

      protected abstract TraceCryptoProvider createProvider()
      Returns:
      the provider under test, ready for use
    • label

      protected abstract String label()
      Returns:
      the label used in the report, e.g. JAVA