You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2014/09/17 17:49:34 UTC

[jira] [Commented] (LUCENE-5959) Optimized memory management in Automaton.Builder.finish()

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

Michael McCandless commented on LUCENE-5959:
--------------------------------------------

Thanks, this is a nice fix!  Maybe instead of using ArrayUtil.grow in that new private method, we could just alloc to that exact size?  (Since the Builder knows it will only add exactly that many transitions...).

> Optimized memory management in Automaton.Builder.finish()
> ---------------------------------------------------------
>
>                 Key: LUCENE-5959
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5959
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/other
>    Affects Versions: 4.10
>            Reporter: Markus Heiden
>            Priority: Minor
>         Attachments: finish.patch
>
>
> Reworked Automaton.Builder.finish() to not allocate memory stepwise. Added growTransitions(int numTransitions) to be able to resize the transistions array just once.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org