void doTrial()

in src/main/java/org/apache/datasketches/characterization/quantiles/tdigest/TDigestSpeedProfile.java [65:121]


  void doTrial() {
    gen.fillArray(inputValues);
    gen.fillArray(queryValues);

    final long startBuild = System.nanoTime();
    final TDigest sketch = TDigest.createDigest(k);
    final long stopBuild = System.nanoTime();
    buildTimeNs += stopBuild - startBuild;

    final long startUpdate = System.nanoTime();
    for (int i = 0; i < inputValues.length; i++) {
      sketch.add(inputValues[i]);
    }
    final long stopUpdate = System.nanoTime();
    updateTimeNs += stopUpdate - startUpdate;

    final long startGetQuantile = System.nanoTime();
    for (final double value: queryValues) {
      sketch.quantile(value);
    }
    final long stopGetQuantile = System.nanoTime();
    getQuantileTimeNs += stopGetQuantile - startGetQuantile;

    final long startGetRank = System.nanoTime();
    for (final double value: queryValues) {
      sketch.cdf(value);
    }
    final long stopGetRank = System.nanoTime();
    getRankTimeNs += stopGetRank - startGetRank;

    buf.rewind();
    final long startSerialize = System.nanoTime();
    sketch.asBytes(buf);
    final long stopSerialize = System.nanoTime();
    serializeTimeNs += stopSerialize - startSerialize;
    buf.rewind();
    final long startDeserialize = System.nanoTime();
    MergingDigest.fromBytes(buf);
    final long stopDeserialize = System.nanoTime();
    deserializeTimeNs += stopDeserialize - startDeserialize;
    buf.rewind();
    final long startSmallSerialize = System.nanoTime();
    sketch.asSmallBytes(buf);
    final long stopSmallSerialize = System.nanoTime();
    smallSerializeTimeNs += stopSmallSerialize - startSmallSerialize;
    buf.rewind();
    final long startSmallDeserialize = System.nanoTime();
    MergingDigest.fromBytes(buf);
    final long stopSmallDeserialize = System.nanoTime();
    smallDeserializeTimeNs += stopSmallDeserialize - startSmallDeserialize;

    // could record the last one since they must be the same
    // but let's average across all trials to see if there is an anomaly
    numRetainedItems += sketch.centroidCount();
    serializedSizeBytes += sketch.byteSize();
    smallSerializedSizeBytes += sketch.smallByteSize();
  }