lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shay Banon (JIRA)" <>
Subject [jira] [Commented] (LUCENE-5634) Reuse TokenStream instances in Field
Date Wed, 30 Apr 2014 22:37:16 GMT


Shay Banon commented on LUCENE-5634:

this optimization has proven to help a lot in the context of ES, but we can use a static thread
local since we are fully in control of the threading model. With Lucene itself, where it can
be used in many different environment, then this can cause some unexpected behavior. For example,
this might cause Tomcat to warn on leaking resources when unloading a war.

> Reuse TokenStream instances in Field
> ------------------------------------
>                 Key: LUCENE-5634
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>             Fix For: 4.9, 5.0
>         Attachments: LUCENE-5634.patch
> If you don't reuse your Doc/Field instances (which is very expert: I
> suspect few apps do) then there's a lot of garbage created to index each
> StringField because we make a new StringTokenStream or
> NumericTokenStream (and their Attributes).
> We should be able to re-use these instances via a static
> ThreadLocal...

This message was sent by Atlassian JIRA

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

View raw message