Performance optimization: eliminate redundant allocation of SimpleDateFormat instances in ElasticSearchReporter
SereneAnt opened this issue · comments
The single line in StringUtils#getLogstashStyleDate(long)
produces about 7-8% of total stagemonitor TLAB allocation (GC pressure) in my production system.
The optimizaton is pretty trivial: wrap stateful DateFormat
instances into ThreadLocal
that is safely initialized and accessed per thread.