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

ParseDateFieldUpdateProcessorFactory should reuse ParsePosition

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 8.0
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: