Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901222

Enable benchmarks to have configurable Operation unit

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • tools
    • None
    • jmh

      Today all benchmarks will have ops/TimeUnit or TimeUnit/op.

      For some benchmarks it would be a nice feature to be able to express the Operation to be more specific to what is actually measured.

      An example would be a benchmark working on a byte[] and to better understand the performance of the benchmark the output could be bytes/TimeUnit or TimeUnit/byte, which would be more inline in what the benchmark actually tries to measure.

      A suggested approach would to have an annotation allow the user to set the Operation unit.

      Something similar to this.

          @Benchmark
          @OperationUnit(singular = "byte")
          @OperationsPerInvocation(64 * 1024)
          public void measureBytes() {
              random.nextBytes(bytes);
          }

          @Benchmark
          @OperationUnit(singular = "foot", plural = "feet")
          @OperationsPerInvocation(64 * 1024)
          public void measureDistance() {
              random.nextBytes(bytes);
          }

            Unassigned Unassigned
            sfriberg Staffan Friberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: