In addition to the work done for
LOG4J2-812 (replace synchronized SimpleDateFormat with commons FastDateFormat) I see a way to improve performance for the timestamp even further.
Ralph posted some very nice JMH benchmark results in
LOG4J2-812, where the combination of caching, FastDateFormat and an AtomicReference was the winner.
I believe this is the way to go, but we may be able to do even better. For some common date formats, it is possible to get a 5X speedup versus FastDateFormat.
This is not as generic as FastDateFormat; at the moment it only supports HH:mm:ss,SSS. I would like to support the "common" DatePatternConverter formats ABSOLUTE, COMPACT, DATE_AND_TIME, DEFAULT, ISO8601_BASIC and ISO8601. For any other date format pattern we fall back to FastDateFormat.
Performance results are below (benchmark is in git master):