String.replace 用的不对性能可能差 10 倍,你用对了吗?
文章目录
String.replace vs StringUtils.replace
什么是 JMH
使用 JMH 测试 replace
JMH基本概念
源码 & 课后题
String.replace vs StringUtils.replace
字符串的 replace 是我们平时最常用的操作了,那么你用对了吗?我们下面就快速的比较一下 String.replace 和 StringUtils.replace 的性能,你就会发现平时用的对不对了。
Benchmark
原创
2020-07-22 15:54:55 ·
3017 阅读 ·
0 评论