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

Andrzej Bialecki  commented on SOLR-12725:
------------------------------------------

Thinking more about this, I suspect we might get more benefit from a simple LRU 
caching - then at least for updates that have the same dateStr, either across 
different fields or across different documents, we could skip parsing 
altogether at the cost of some memory and LRU cache operations... but this too 
is outside the scope of this issue.

> ParseDateFieldUpdateProcessorFactory should reuse ParsePosition
> ---------------------------------------------------------------
>
>                 Key: SOLR-12725
>                 URL: https://issues.apache.org/jira/browse/SOLR-12725
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Andrzej Bialecki 
>            Assignee: Andrzej Bialecki 
>            Priority: Minor
>
> {{ParseDateFieldUpdateProcessorFactory.parseInstant}} repeatedly calls all 
> configured date parsers ({{DateTimeFormatter}}-s) for each incoming date-like 
> field. However, it uses {{DateTimeFormatter.parse(dateStr)}} method that 
> needs to allocate a throwaway instance of {{ParsePosition}}, instead of 
> {{DateTimeFormatter.parse(dateStr, parsePosition)}}.
> Javadocs for this method suggest reusing (and reseting) a single instance of 
> {{ParsePosition}} for multiple calls in order to reduce object allocations.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to