mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
Reduce memory churn in KeywordCounter
This commit is contained in:
parent
8349435ef4
commit
5558af148e
@ -43,8 +43,8 @@ public class KeywordCounter {
|
|||||||
|
|
||||||
counts.mergeInt(rep.stemmed, 1, Integer::sum);
|
counts.mergeInt(rep.stemmed, 1, Integer::sum);
|
||||||
|
|
||||||
var instanceSet = instances.computeIfAbsent(rep.stemmed, k -> new HashSet<>(500));
|
var instanceSet = instances.computeIfAbsent(rep.stemmed, k -> new HashSet<>(16));
|
||||||
if (instanceSet.size() < 250) {
|
if (instanceSet.size() < 4) {
|
||||||
instanceSet.add(rep);
|
instanceSet.add(rep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user