Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-12725

ParseDateFieldUpdateProcessorFactory should reuse ParsePosition

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.0
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              ab Andrzej Bialecki
              Reporter:
              ab Andrzej Bialecki
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: