apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.45k stars 973 forks source link

Replace Map<Integer, Object> by primitive IntObjectHashMap. #13368

Closed bruno-roustant closed 1 month ago

bruno-roustant commented 1 month ago

Also replace some Map<Integer, Integer> by IntIntHashMap, if they don't rely on null value.

The goal is to gain globally some memory, maybe some perf on some spots that call the map intensively, with a replacement that does not seem to bring complexity. Most of the time it consists in changing a field type to the primitive map, and the call to the map constructor. If some areas shouldn't be modified, we can exclude them from the replacement.