RFR(S): 8055004: Reduce allocation overhead in java.time.Period/Duration parse methods

Claes Redestad claes.redestad at oracle.com
Wed Aug 13 12:50:13 UTC 2014


can I have a review of this performance improvement to 
java.time.Period#parse and java.time.Duration#parse?

bug: https://bugs.openjdk.java.net/browse/JDK-8055004
webrev: http://cr.openjdk.java.net/~redestad/8055004/webrev.0

The patch avoids String allocation through matcher.group(n) calls, 
utilizes recently added
capability of parsing CharSequence offsets and improves on the rather 
awkward way fractions of a second
was aligned to nanosecond precision in java.time.Duration.

Microbenchmarks show a 1.2-1.5x throughput improvement in both cases.



More information about the core-libs-dev mailing list