-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b08
-
Verified
The Matcher class has a few public methods that take StringBuffers,
and we've found it useful to add similar versions that take StringBuilders.
It has two benefits:
- Users don't have to convert from one to the other when they want to use
the method in question. The symmetry is nice.
- The StringBuilder variants are faster (if lock optimizations don't kick
in, which happens in the interpreter and the client compiler). For
interpreted / client-compiled code, we saw something like a 25% speedup on
String.replaceAll(), which calls into this code.
and we've found it useful to add similar versions that take StringBuilders.
It has two benefits:
- Users don't have to convert from one to the other when they want to use
the method in question. The symmetry is nice.
- The StringBuilder variants are faster (if lock optimizations don't kick
in, which happens in the interpreter and the client compiler). For
interpreted / client-compiled code, we saw something like a 25% speedup on
String.replaceAll(), which calls into this code.
- duplicates
-
JDK-8039964 Matcher should support StringBuilder
-
- Closed
-
-
JDK-8058277 Matcher doesn't provide option to use StringBuilder
-
- Closed
-
- relates to
-
JDK-8041398 Doclint regresion in java.util.regex
-
- Resolved
-