[
https://issues.apache.org/jira/browse/SOLR-12725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16618398#comment-16618398
]
David Smiley commented on SOLR-12725:
-------------------------------------
bq. I like that idea, but it seems a lot more involved then just re-using a
single ParsePosition repeatedly for a single input string? should probably be
it's own issue?
It's not an either-or .... quoting myself "we might _also_" . Yes perhaps a
different issue though I don't care either way.
bq. IIUC you seem to be theorizing that by re-using a single ParsePosition ...
No; my idea has nothing to do with ParsePosition. It's simply about which
index into the list of formats do you start attempting to see if it matched.
It'd loop back to the first and ultimately try them all if need be.
> 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]