Skip to content

Commit

Permalink
log debug recodemap time
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Oct 23, 2024
1 parent f865762 commit 8c41a2a
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -123,13 +124,20 @@ public synchronized final Map<T,Integer> getRecodeMap(int estimate, ExecutorServ
}

protected Map<T,Integer> createRecodeMap(int estimate, ExecutorService pool) {
// final Map<T,Integer> map = new HashMap<>((int)Math.min((long)estimate *2, size()));
Timing t = new Timing();
final int s = size();
int k = OptimizerUtils.getTransformNumThreads();
Map<T,Integer> 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<T,Integer> parallelCreateRecodeMap(int estimate,ExecutorService pool, final int s, int k) {
Expand Down

0 comments on commit 8c41a2a

Please sign in to comment.