stagemonitor / stagemonitor

an open source solution to application performance monitoring for java server applications

Home Page:www.stagemonitor.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Performance optimization: eliminate redundant allocation of SimpleDateFormat instances in ElasticSearchReporter

SereneAnt opened this issue · comments

commented

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.