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/05/16 11:32:00 UTC
[jira] [Created] (MIME4J-298) DateTimeFieldLenientImpl: Migrate
from SimpleDateFormat to DateTimeFormatter
Benoit Tellier created MIME4J-298:
-------------------------------------
Summary: 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
Fix For: 0.8.6
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)