Closed theigl closed 4 years ago
@lincolnthree: Please review.
Hey @theigl apologies for the delay. Crazy around here with the launch of www.topdecked.com approaching. This looks great, will get it released ASAP.
Thanks @lincolnthree! And all the best for your launch!
V 4.0.6.Final
has been released to Sonatyle OSSRH staging/releases repo and should be available in Maven Central after tonight's nightly sync. Thanks so much for this performance enhancement!
I'm surprised nobody noticed this before, as it's a huge improvement/hotspot fix.
Also thank you :) Not much sleep around here right now!
String formatting in PrettyTime frequently shows up in my JFR profiler. It really should not, because it only performs basic string operations.
This PR applies two simple optimizations to
SimpleTimeFormat
:String.replace
instead ofString.replaceAll
for simple replacementsThe optimized version is nearly 4 times faster: