Class StringConstructBenchmark

  • public class StringConstructBenchmark
    extends java.lang.Object
    A benchmark of the most common patterns that are used to construct gradually String objects.

    The benchmark emphasizes on the build patterns that appear in the Calcite project.

    • Constructor Detail

      • StringConstructBenchmark

        public StringConstructBenchmark()
    • Method Detail

      • initStringBuilder

        public java.lang.StringBuilder initStringBuilder()
      • initStringWriter

        public initStringWriter()
      • appendString

        public void appendString​(org.openjdk.jmh.infra.Blackhole bh,
                                 StringConstructBenchmark.AppenderState appenderState)
        Benchmarks the performance of instantiating different Appendable objects and appending the same string a fixed number of times.
        bh - blackhole used as an optimization fence
        appenderState - the state holds the type of the appender and the number of appends that need to be performed before resetting the appender
        Throws: - if the append operation encounters an I/O problem
      • main

        public static void main​(java.lang.String[] args)
                         throws org.openjdk.jmh.runner.RunnerException