Skip to content

Commit

Permalink
allow JIT
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Oct 21, 2024
1 parent a64a708 commit 2b02286
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,24 @@ public synchronized final Map<T, Long> getRecodeMap() {
* @return The recode map
*/
protected Map<T, Long> createRecodeMap() {
Map<T, Long> map = new HashMap<>();
final Map<T, Long> map = new HashMap<>();
long id = 1;
for(int i = 0; i < size(); i++) {
T val = get(i);
if(val != null) {
Long v = map.putIfAbsent(val, id);
if(v == null)
id++;
}
}
for(int i = 0; i < size(); i++)
id = addValRecodeMap(map, id, i);

return map;
}

private long addValRecodeMap(Map<T, Long> map, long id, int i) {
T val = get(i);
if(val != null) {
Long v = map.putIfAbsent(val, id);
if(v == null)
id++;
}
return id;
}

/**
* Get the number of elements in the array, this does not necessarily reflect the current allocated size.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ private List<AColGroup> singleThread(List<ColumnEncoderComposite> encoders)
private List<AColGroup> multiThread(List<ColumnEncoderComposite> encoders)
throws InterruptedException, ExecutionException {
try {
List<Future<AColGroup>> tasks = new ArrayList<>(encoders.size());
final List<Future<AColGroup>> tasks = new ArrayList<>(encoders.size());
for(ColumnEncoderComposite c : encoders)
tasks.add(pool.submit(() -> encode(c)));
List<AColGroup> groups = new ArrayList<>(encoders.size());
final List<AColGroup> groups = new ArrayList<>(encoders.size());
for(Future<AColGroup> t : tasks)
groups.add(t.get());
return groups;
Expand Down

0 comments on commit 2b02286

Please sign in to comment.