in src/main/java/org/apache/datasketches/characterization/theta/ThetaUnionUpdateSpeedProfile.java [51:79]
public double doTrial(final int uPerTrial) {
for (int i = 0; i < numSketches; i++) {
updateSketches[i] = sketchBuilder.build();
}
{ // spray values across all sketches
int i = 0;
for (int u = uPerTrial; u-- > 0;) {
updateSketches[i++].update(++vIn);
if (i == numSketches) { i = 0; }
}
}
{ // trim and compact sketches
for (int i = 0; i < numSketches; i++) {
compactSketches[i] = updateSketches[i].rebuild().compact();
}
}
final Union union = setOpBuilder.buildUnion();
final long startUpdateTime_nS = System.nanoTime();
for (int i = numSketches; i-- > 0;) {
union.union(compactSketches[i]);
}
final long updateTime_nS = System.nanoTime() - startUpdateTime_nS;
return updateTime_nS;
}