Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-495

Metadata constructor is slow

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.8
    • 0.8
    • metadata
    • None

    Description

      Metadata constructor initialises a bunch of SimpleTimeFormat objects. This is slow - they need to parse their configuration strings, system must be queried for timezone, and so on. In my simple test in which I create new Metadata object for each new document this accounts for approximately 25-30% of all time spent in Tika.

      As pointed out by Nick Burch, SimpleTimeFormat is not threadsafe, so they can't be static.

      Possible solutions include using org.apache.commons.lang.time.FastDateFormat instead (if its features are sufficient), or using thread local objects.

      Attachments

        1. TIKA-495.patch
          6 kB
          Jukka Zitting

        Activity

          People

            jukkaz Jukka Zitting
            syskin Radek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: