lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrzej Bialecki (JIRA)" <>
Subject [jira] [Commented] (SOLR-12725) ParseDateFieldUpdateProcessorFactory should reuse ParsePosition
Date Tue, 18 Sep 2018 15:18:00 GMT


Andrzej Bialecki  commented on SOLR-12725:

The scope of this issue was just to avoid unnecessary object creation - reusable instance
of ParsePosition will have to be reset between reuses.

Since URP instances are created per request I could see some benefit in optimizing the scanning
order of the formats - but this may be tricky to get right. If there are eg. two or more formats
that could match input values but the user's preference is for the first one on the list -
with a document that failed the top formats but matched any subsequent format the processing
could get stuck on that format for other documents too, even though it's not the most preferred

> ParseDateFieldUpdateProcessorFactory should reuse ParsePosition
> ---------------------------------------------------------------
>                 Key: SOLR-12725
>                 URL:
>             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

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

View raw message