Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
We use JDK's String.replaceAll(String regex, String replacement) about 60 times in the code, but most of these should probably use String.replace(CharSequence target, CharSequence replacement).
replaceAll uses regex semantics, which is slow (it compiles a pattern each call) and probably not desired behavior.
Consider adding to forbidden-apis/signatures.txt to prevent it from being accidentally used in future.
See tweet "String.replaceAll is the most invisible java perf issue I end up finding out of profiles".
Attachments
Issue Links
- links to