You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2021/01/09 00:40:28 UTC
[datasketches-characterization] branch master updated: Remove AoD
tests
This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/datasketches-characterization.git
The following commit(s) were added to refs/heads/master by this push:
new 785db18 Remove AoD tests
785db18 is described below
commit 785db188c54c7842d60095dc47868bbcbf60b50d
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Fri Jan 8 16:40:12 2021 -0800
Remove AoD tests
---
.../tuple/AodSketchUpdateSpeedProfile.java | 76 -------------------
.../tuple/AodUnionUpdateSpeedProfile.java | 88 ----------------------
2 files changed, 164 deletions(-)
diff --git a/src/main/java/org/apache/datasketches/characterization/tuple/AodSketchUpdateSpeedProfile.java b/src/main/java/org/apache/datasketches/characterization/tuple/AodSketchUpdateSpeedProfile.java
deleted file mode 100644
index 323092c..0000000
--- a/src/main/java/org/apache/datasketches/characterization/tuple/AodSketchUpdateSpeedProfile.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.datasketches.characterization.tuple;
-
-import org.apache.datasketches.ResizeFactor;
-import org.apache.datasketches.characterization.uniquecount.BaseUpdateSpeedProfile;
-import org.apache.datasketches.memory.WritableDirectHandle;
-import org.apache.datasketches.memory.WritableMemory;
-import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion;
-import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch;
-import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder;
-
-public class AodSketchUpdateSpeedProfile extends BaseUpdateSpeedProfile {
- protected ArrayOfDoublesUpdatableSketch sketch;
- private WritableDirectHandle handle;
- private WritableMemory wmem;
-
-
- @Override
- public void configure() {
- //Configure Sketch
- final int lgK = Integer.parseInt(prop.mustGet("LgK"));
- final int numValues = Integer.parseInt(prop.mustGet("NumValues"));
- final float p = Float.parseFloat(prop.mustGet("SamplingProbability"));
- final ResizeFactor rf = ResizeFactor.getRF(Integer.parseInt(prop.mustGet("ResizeFactor")));
- final boolean offheap = Boolean.parseBoolean(prop.mustGet("Offheap"));
-
- final int k = 1 << lgK;
- final ArrayOfDoublesUpdatableSketchBuilder udBldr = new ArrayOfDoublesUpdatableSketchBuilder()
- .setNominalEntries(k).setNumberOfValues(numValues).setSamplingProbability(p).setResizeFactor(rf);
- if (offheap) {
- final int bytes = ArrayOfDoublesUnion.getMaxBytes(k, numValues);
- handle = WritableMemory.allocateDirect(bytes);
- wmem = handle.get();
- sketch = udBldr.build(wmem);
- } else {
- sketch = udBldr.build();
- }
- }
-
- @Override
- public void cleanup() {
- if (handle != null) { handle.close(); }
- }
-
- @Override
- public double doTrial(final int uPerTrial) {
- sketch.reset(); // reuse the same sketch
- final double[] values = new double[sketch.getNumValues()];
- final long startUpdateTime_nS = System.nanoTime();
-
- for (int u = uPerTrial; u-- > 0;) {
- sketch.update(++vIn, values);
- }
- final long updateTime_nS = System.nanoTime() - startUpdateTime_nS;
- return (double) updateTime_nS / uPerTrial;
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/characterization/tuple/AodUnionUpdateSpeedProfile.java b/src/main/java/org/apache/datasketches/characterization/tuple/AodUnionUpdateSpeedProfile.java
deleted file mode 100644
index e32f2e3..0000000
--- a/src/main/java/org/apache/datasketches/characterization/tuple/AodUnionUpdateSpeedProfile.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.datasketches.characterization.tuple;
-
-import java.lang.reflect.Array;
-
-import org.apache.datasketches.characterization.uniquecount.BaseUpdateSpeedProfile;
-import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesCompactSketch;
-import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder;
-import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion;
-import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch;
-import org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder;
-
-public class AodUnionUpdateSpeedProfile extends BaseUpdateSpeedProfile {
- private int lgK;
- private int numSketches;
- private int numValues;
- private ArrayOfDoublesUpdatableSketch[] updateSketches;
- private ArrayOfDoublesCompactSketch[] compactSketches;
- private ArrayOfDoublesUpdatableSketchBuilder sketchBuilder;
- private ArrayOfDoublesSetOperationBuilder setOpBuilder;
-
- @Override
- public void configure() {
- lgK = Integer.parseInt(prop.mustGet("LgK"));
- numSketches = Integer.parseInt(prop.mustGet("NumSketches"));
- numValues = Integer.parseInt(prop.mustGet("NumValues"));
- updateSketches = (ArrayOfDoublesUpdatableSketch[])
- Array.newInstance(ArrayOfDoublesUpdatableSketch.class, numSketches);
- compactSketches = (ArrayOfDoublesCompactSketch[])
- Array.newInstance(ArrayOfDoublesCompactSketch.class, numSketches);
- sketchBuilder = new ArrayOfDoublesUpdatableSketchBuilder().setNominalEntries(1 << lgK)
- .setNumberOfValues(numValues);
- setOpBuilder = new ArrayOfDoublesSetOperationBuilder().setNominalEntries(1 << lgK)
- .setNumberOfValues(numValues);
- }
-
- @Override
- public double doTrial(final int uPerTrial) {
- for (int i = 0; i < numSketches; i++) {
- updateSketches[i] = sketchBuilder.build();
- }
-
- final double[] values = new double[numValues];
- { // spray keys across all sketches
- int i = 0;
- for (int u = uPerTrial; u-- > 0;) {
- updateSketches[i++].update(++vIn, values);
- if (i == numSketches) { i = 0; }
- }
- }
-
- { // trim and compact sketches
- for (int i = 0; i < numSketches; i++) {
- updateSketches[i].trim();
- compactSketches[i] = updateSketches[i].compact();
- }
- }
-
- final ArrayOfDoublesUnion union = setOpBuilder.buildUnion();
- final long startUpdateTime_nS = System.nanoTime();
-
- for (int i = numSketches; i-- > 0;) {
- union.update(compactSketches[i]);
- }
-
- final long updateTime_nS = System.nanoTime() - startUpdateTime_nS;
- return updateTime_nS;
- }
-
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org