Class BaselineGenerationPerformance


  • public class BaselineGenerationPerformance
    extends Object
    Benchmarks to check linearity in the baseline implementations of UniformRandomProvider.

    These ordinarily do not need to be run. The benchmarks can be used to determine if the baseline scales linearly with workload. If not then the JVM has removed the baseline from the testing loop given that its result is predictable. The ideal baseline will:

    • Run as fast as possible
    • Not be removed from the execution path

    The results of this benchmark should be plotted for each method using [numValues] vs [run time] to check linearity.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void nextBoolean​(org.openjdk.jmh.infra.Blackhole bh)
      Exercise the UniformRandomProvider.nextBoolean() method.
      void nextBytes​(org.openjdk.jmh.infra.Blackhole bh)
      Exercise the UniformRandomProvider.nextBytes(byte[]) method.
      void nextDouble​(org.openjdk.jmh.infra.Blackhole bh)
      Exercise the UniformRandomProvider.nextDouble() method.
      void nextFloat​(org.openjdk.jmh.infra.Blackhole bh)
      Exercise the UniformRandomProvider.nextFloat() method.
      void nextInt​(org.openjdk.jmh.infra.Blackhole bh)
      Exercise the UniformRandomProvider.nextInt() method.
      void nextIntN​(org.openjdk.jmh.infra.Blackhole bh)
      Exercise the UniformRandomProvider.nextInt(int) method.
      void nextLong​(org.openjdk.jmh.infra.Blackhole bh)
      Exercise the UniformRandomProvider.nextLong() method.
      void nextLongN​(org.openjdk.jmh.infra.Blackhole bh)
      Exercise the UniformRandomProvider.nextLong(long) method.
    • Method Detail

      • nextBytes

        public void nextBytes​(org.openjdk.jmh.infra.Blackhole bh)
        Exercise the UniformRandomProvider.nextBytes(byte[]) method.

        Note: Currently there is not a test for UniformRandomProvider.nextBytes(byte[], int, int) since the two methods are implemented by the base Int/LongProvider class using the same code.

        Parameters:
        bh - Data sink.
      • nextInt

        public void nextInt​(org.openjdk.jmh.infra.Blackhole bh)
        Exercise the UniformRandomProvider.nextInt() method.
        Parameters:
        bh - Data sink.
      • nextIntN

        public void nextIntN​(org.openjdk.jmh.infra.Blackhole bh)
        Exercise the UniformRandomProvider.nextInt(int) method.
        Parameters:
        bh - Data sink.
      • nextLong

        public void nextLong​(org.openjdk.jmh.infra.Blackhole bh)
        Exercise the UniformRandomProvider.nextLong() method.
        Parameters:
        bh - Data sink.
      • nextLongN

        public void nextLongN​(org.openjdk.jmh.infra.Blackhole bh)
        Exercise the UniformRandomProvider.nextLong(long) method.
        Parameters:
        bh - Data sink.
      • nextBoolean

        public void nextBoolean​(org.openjdk.jmh.infra.Blackhole bh)
        Exercise the UniformRandomProvider.nextBoolean() method.
        Parameters:
        bh - Data sink.
      • nextFloat

        public void nextFloat​(org.openjdk.jmh.infra.Blackhole bh)
        Exercise the UniformRandomProvider.nextFloat() method.
        Parameters:
        bh - Data sink.
      • nextDouble

        public void nextDouble​(org.openjdk.jmh.infra.Blackhole bh)
        Exercise the UniformRandomProvider.nextDouble() method.
        Parameters:
        bh - Data sink.