Closed slandelle closed 3 years ago
@igr I don't have time to run benchmarks atm, sorry. Feel free to run some on your side or wait for me before merging.
I will wait with this a bit, some tests are failing. Will be moved to new jodd-util
repo.
@igr Could you please point to the failing tests?
See here: https://github.com/oblac/jodd-util/pull/2
I just copy/paste the code, so maybe I am missing something
@igr I found my stupid mistake. I commented on your PR.
It works! I am adding a simple JMH test and will release
Mmm, I see that StringUtils#remove can be implemented in a more efficient fashion. Please let me send a PR before benchmarking and releasing.
Also, please note I only used StringBuilderPool on the methods that are used in Lagarto. If experiment is successful, you'll probably want to update lots of code in Jodd (eg StringUtils is full for allocated StringBuilders).
Yes yes, just want to do it a step by step. The first release is for the Lagarto, and then I will slowly apply furthermore.
Motivation:
A lot of StringBuilders are allocated on the hotpath, in particular in utils used Lagarto.
Modifications:
Result:
Util to pool StringBuilder instances