diff --git a/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java b/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java index 75675693386..90fd99fc10f 100644 --- a/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java +++ b/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java @@ -40,6 +40,7 @@ import org.apache.sysds.runtime.frame.data.columns.ArrayFactory.FrameArrayType; import org.apache.sysds.runtime.frame.data.compress.ArrayCompressionStatistics; import org.apache.sysds.runtime.matrix.data.Pair; +import org.apache.sysds.utils.stats.Timing; /** * Generic, resizable native arrays for the internal representation of the columns in the FrameBlock. We use this custom @@ -123,13 +124,20 @@ public synchronized final Map getRecodeMap(int estimate, ExecutorServ } protected Map createRecodeMap(int estimate, ExecutorService pool) { - // final Map map = new HashMap<>((int)Math.min((long)estimate *2, size())); + Timing t = new Timing(); final int s = size(); int k = OptimizerUtils.getTransformNumThreads(); + Map ret; if(pool == null || s < 10000) - return createRecodeMap(estimate, 0, s); + ret = createRecodeMap(estimate, 0, s); else - return parallelCreateRecodeMap(estimate, pool, s, k); + ret = parallelCreateRecodeMap(estimate, pool, s, k); + + if(LOG.isDebugEnabled()) { + String base = "CreateRecodeMap estimate: %10d actual %10d time: %10.5f"; + LOG.debug(String.format(base, estimate, ret.size(), t.stop())); + } + return ret; } private Map parallelCreateRecodeMap(int estimate,ExecutorService pool, final int s, int k) {