[ 
https://issues.apache.org/jira/browse/LUCENE-10097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17423780#comment-17423780
 ] 

Bruno Roustant commented on LUCENE-10097:
-----------------------------------------

Based on remarks in the PRs, I'm closing this Jira issue as HashMap + List is 
too complicated and TreeMap was a deliberated choice for keeping the memory 
usage low.
Maybe I'll come back later with another proposal as I think most of the time we 
use TreeMap whereas the intent is to build an immutable sorted map, which could 
be more memory efficient.

> Replace TreeMap use by HashMap when unnecessary
> -----------------------------------------------
>
>                 Key: LUCENE-10097
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10097
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Bruno Roustant
>            Assignee: Bruno Roustant
>            Priority: Major
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> There are a couple of places where TreeMap is used although it could easily 
> be replaced by a HashMap with potentially a single sort. Sometimes it would 
> bring perf improvement (e.g. when TreeMap.entrySet() is called), other times 
> it's more for consistency to use a simpler HashMap if there is no strong need 
> for a TreeMap.
> I saw other places where we have TODOs to see whether we can replace the 
> TreeMap, but when it is more complex, I'll prefer to open separate Jira 
> issues.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to