lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] [Commented] (LUCENE-6325) improve perf and memory of FieldInfos.fieldInfo(int)
Date Fri, 26 Jun 2015 13:44:04 GMT


Michael McCandless commented on LUCENE-6325:

+1, this looks like an easy, possibly high-impact win.

I think we can be more aggressive about using the array: TreeMap has much more than 50% overhead,
since it also needs Integer key and pointer to that key, and object overhead holding that
key pointer and value pointer.  I think we can safely do this opto when it's > 10% of the

> improve perf and memory of FieldInfos.fieldInfo(int)
> ----------------------------------------------------
>                 Key: LUCENE-6325
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Sub-task
>            Reporter: Robert Muir
>             Fix For: 5.2, Trunk
>         Attachments: LUCENE-6325.patch
> FieldInfos.fieldInfo(int) looks up a field by number and returns its FieldInfo.
> This method is called per-field-per-doc in things like stored fields and vectors readers.
> Unfortunately, today this method is always backed by a TreeMap. In most cases a simple
array is better, its faster and uses less memory.
> These changes made significant difference in stored fields checkindex time with my test
index (had only 10 fields). Maybe it helps merge as well.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message