You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by "Benoit Tellier (Jira)" <mi...@james.apache.org> on 2021/06/16 05:58:00 UTC

[jira] [Updated] (MIME4J-298) DateTimeFieldLenientImpl: Migrate from SimpleDateFormat to DateTimeFormatter

     [ https://issues.apache.org/jira/browse/MIME4J-298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benoit Tellier updated MIME4J-298:
----------------------------------
    Attachment: MIME4J-298-cpu.png
                MIME4J-298-mem.png

> DateTimeFieldLenientImpl: Migrate from SimpleDateFormat to DateTimeFormatter
> ----------------------------------------------------------------------------
>
>                 Key: MIME4J-298
>                 URL: https://issues.apache.org/jira/browse/MIME4J-298
>             Project: James Mime4j
>          Issue Type: Improvement
>          Components: dom
>    Affects Versions: 0.8.5
>            Reporter: Benoit Tellier
>            Priority: Major
>             Fix For: 0.8.6
>
>         Attachments: MIME4J-298-cpu.png, MIME4J-298-mem.png
>
>
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)