09/02
2017

The poor performance of kotlin string replace

The manifestViewer tool of Dev Tools Pro is written by Kotlin, it’s so slowly on some devices. I found it’s caused by String.replace after performance tuning.

 

The size of the source text is about 1.1m, call replace three times, replace of Kotlin takes about 2123ms, replace of Java takes about 250ms.

 

why the performance is so poor. The source code of Kotlin is here, will found it use split and join. but Java use regx.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

2 thoughts on “The poor performance of kotlin string replace