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<Long, Object> by primitive LongObjectHashMap. #13392

Closed bruno-roustant closed 1 month ago

bruno-roustant commented 1 month ago

No functional changes, only replacements by primitve maps.

Adds LongObjectHashMap and LongIntHashMap to the org.apache.lucene.util.hppc package, with some refactoring.

Adds a dependency to com.carrotsearch.hppc to the join and spatial modules. This dependency is already present in the facet module. This way these packages can use primitive hash map with float or double values.

The changes in the JoinUtil class are a good example of usage of primitive structures. This highly reduces the auto-boxing around primitives.