Should mappings keep using CopyOnWriteHashMap? #80072
Labels
>refactoring
:Search Foundations/Mapping
Index mappings, including merging and defining field types
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
CopyOnWriteHashMap
was introduced for mappings at a time when some Logging use-cases would introduce many (as in several thousands) fields dynamically and applying mapping updates would be the bottleneck due to the time it would take to apply mapping updates.However several things changed since then:
This
CopyOnWriteHashMap
optimizes for mapping updates to the detriment of lookups, which can be slower than with regular hash maps, especially in case of hash collisions. We should look into moving back to regular maps that we would fully copy upon mapping updates.The text was updated successfully, but these errors were encountered: