arkanovicz commented on PR #12: URL: https://github.com/apache/velocity-tools/pull/12#issuecomment-1307816850
Thanks for identifying this issue. On [this page](https://stackoverflow.com/questions/4387170/decimalformat-formatdouble-in-different-threads) someone had a measurement of ~23ms for the format instantiation. This is a figure which is highly dependent on the measurement conditions but still, it means that in terms of number of cycles its order of magnitude to be taken into consideration. The thread-local paradigm is not optimal here since in a web context for instance, requests are rarely made by the same thread. I would rather use a pool, each thread taking a format instance from the pool and putting it back afterwards. Apache commons has plenty of ready-made pools for this use case. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org For additional commands, e-mail: dev-h...@velocity.apache.org