FastStringBenchmark
Date: 2016-02-29

de.zib.scalaris.examples

## Class FastStringBenchmark

- java.lang.Object
- - de.zib.scalaris.Benchmark
  - - de.zib.scalaris.examples.FastStringBenchmark

-     public class FastStringBenchmark
      extends Benchmark

  Mini benchmark of the `Transaction` and `TransactionSingleOp` class using custom objects provided by `ErlangValueFastString` and `ErlangValueBitString`.

  Run the benchmark with `java -cp scalaris-examples.jar de.zib.scalaris.examples.FastStringBenchmark`

  Since:
    2.0
  Version:
    3.0
  Author:
    Nico Kruber, kruber@zib.de

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FastStringBenchmark()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(String[] args)` Runs a mini benchmark of the `Transaction` and `TransactionSingleOp` class using custom objects provided by `ErlangValueFastString` and `ErlangValueBitString`.
    `static void` | `minibench(int operations, int threadsPerNode, Set<Integer> benchmarks)` Runs the benchmark.

    - ### Methods inherited from class de.zib.scalaris.Benchmark

      `getRandom, getRandom`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FastStringBenchmark

          public FastStringBenchmark()

  - ### Method Detail

    - #### main

          public static void main(String[] args)

      Runs a mini benchmark of the `Transaction` and `TransactionSingleOp` class using custom objects provided by `ErlangValueFastString` and `ErlangValueBitString`. Accepts the same parameters as the `Main.main(String[])` method's benchmark parameter.
      Parameters:
        `args` - command line arguments
      See Also:
        `Main.main(String[])`

    - #### minibench

          public static void minibench(int operations,
                       int threadsPerNode,
                       Set<Integer> benchmarks)

      Runs the benchmark. Tests some strategies for writing key/value pairs to scalaris:
      1. writing `OtpErlangBinary` objects (random data, size = `Benchmark.BENCH_DATA_SIZE`)
      2. writing `OtpErlangString` objects (random data, size = `Benchmark.BENCH_DATA_SIZE`)
      3. writing `String` objects (random data, size = `Benchmark.BENCH_DATA_SIZE`)
      4. writing `String` objects by converting them to `OtpErlangBinary`s (random data, size = `Benchmark.BENCH_DATA_SIZE`)
      each with the given number of consecutive operations and parallel threads per Scalaris node,
      - first using a new `Transaction` for each test,
      - then using a new `Transaction` but re-using a single `Connection`,
      - and finally re-using a single `Transaction` object.
      Parameters:
        `operations` - the number of test runs to execute
        `threadsPerNode` - number of threads to spawn for each existing Scalaris node
        `benchmarks` - the benchmarks to run (1-9 or -1 for all benchmarks)