Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-298

DateTimeFieldLenientImpl: Migrate from SimpleDateFormat to DateTimeFormatter

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8.5
    • 0.8.6
    • dom
    • None

    Description

      SimpleDateFormat is instanciated for each invocation of DateTimeFieldLenientImpl::parse because SimpleDateFormat is not thread safe.

      Using DateTimeFormatter would allow us to initialize it once at class-loading time.

      Furthermore we should order the time formats so that the most frequents show up first, limiting the total count of parsing passes.

      A simple flame graph study showed date parsing represents 20% of the CPU time when computing a MessageFastView projection, almost comparable to the full header parsing... I would like to lower that CPU time!

      Reopen of https://issues.apache.org/jira/browse/JAMES-3584 on the right bug tracker.

      Attachments

        1. MIME4J-298-cpu.png
          168 kB
          Benoit Tellier
        2. MIME4J-298-mem.png
          211 kB
          Benoit Tellier

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            btellier Benoit Tellier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                Slack

                  Issue deployment