[
https://issues.apache.org/jira/browse/LANG-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730226#action_12730226
]
Henri Yandell commented on LANG-512:
------------------------------------
Completely missed that there's a literal based replace from JDK 1.5 onwards.
Here are the stats when including java.lang.String.replace(CharSequence,
CharSequence). Namely it sucks, at least on OS X.
Length: 19 replacing length 7 with length 6, 5000 times.
LANG PERF: 0:00:00.018
REGX PERF: 0:00:00.066
JDK PERF: 0:00:00.027
Length: 190 replacing length 7 with length 6, 5000 times.
LANG PERF: 0:00:00.028
REGX PERF: 0:00:00.099
JDK PERF: 0:00:00.097
Length: 1900 replacing length 7 with length 6, 5000 times.
LANG PERF: 0:00:00.244
REGX PERF: 0:00:00.778
JDK PERF: 0:00:00.796
Length: 19000 replacing length 7 with length 6, 5000 times.
LANG PERF: 0:00:02.452
REGX PERF: 0:00:07.733
JDK PERF: 0:00:07.687
Length: 17000 replacing length 17 with length 16, 5000 times.
LANG PERF: 0:00:02.121
REGX PERF: 0:00:11.659
JDK PERF: 0:00:11.741
> Compare performance of replace method to regex in Java
> ------------------------------------------------------
>
> Key: LANG-512
> URL: https://issues.apache.org/jira/browse/LANG-512
> Project: Commons Lang
> Issue Type: Sub-task
> Reporter: Henri Yandell
> Fix For: 3.0
>
>
> Can we delete our replace methods?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.