Enable benchmarks to have configurable Operation unit

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: 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);
          }

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

              Created:
              Updated: