DictionaryMap changes.
Add new flag to change the default size to make prod index boot faster. Remove option to select OffHeapDictionaryHashMap.
This commit is contained in:
parent
17ca4f9eea
commit
30584887f9
@ -4,13 +4,8 @@ public interface DictionaryMap {
|
||||
int NO_VALUE = Integer.MIN_VALUE;
|
||||
|
||||
static DictionaryMap create() {
|
||||
if (!Boolean.getBoolean("large-ram")) {
|
||||
return new OnHeapDictionaryMap();
|
||||
}
|
||||
else {
|
||||
return new OffHeapDictionaryHashMap(1L << 31);
|
||||
}
|
||||
}
|
||||
|
||||
int size();
|
||||
|
||||
|
@ -3,7 +3,8 @@ package nu.marginalia.dict;
|
||||
import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
|
||||
|
||||
public class OnHeapDictionaryMap implements DictionaryMap {
|
||||
private final Long2IntOpenHashMap entries = new Long2IntOpenHashMap(100_000, 0.75f);
|
||||
private static final int DEFAULT_SIZE = Integer.getInteger("lexiconSizeHint", 100_000);
|
||||
private final Long2IntOpenHashMap entries = new Long2IntOpenHashMap(DEFAULT_SIZE, 0.75f);
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
|
Loading…
Reference in New Issue
Block a user