• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

apache / commons-lang / 1009 / 1
95%
master: 95%

Build:
DEFAULT BRANCH: master
Ran 12 Oct 2017 08:46AM UTC
Files 138
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Oct 2017 08:42AM UTC coverage: 95.225%. Remained the same
1009.1

Pull #300

travis-ci

web-flow
Improve StringUtils#replace throughput

Motivation:

`StringUtils#replace` uses `substring` to append a String region into a
StringBuilder. This causes useless copies, as `StringBuilder#append`
can take start and end indexes.

Modification:

Use proper `StringBuilder#append`
[overload](https://docs.oracle.com/javase/8/docs/api/java/lang/StringBui
lder.html#append-java.lang.CharSequence-int-int-).

Result:

Based on benchmark from [JOOQ’s
post](https://blog.jooq.org/2017/10/11/benchmarking-jdk-string-replace-v
s-apache-commons-stringutils-replace):

```
Benchmark Mode Cnt Score Error Units
StringReplaceBenchmark.testFastStringReplaceLongStringOneMatch thrpt 21
7546534,219 ± 145523,962 ops/s
StringReplaceBenchmark.testStringUtilsReplaceLongStringOneMatch thrpt
21 7353512,552 ± 124498,228 ops/s

StringReplaceBenchmark.testFastStringReplaceLongStringSeveralMatches
thrpt 21 5077255,810 ± 62358,937 ops/s
StringReplaceBenchmark.testStringUtilsReplaceLongStringSeveralMatches
thrpt 21 4108357,612 ± 92909,038 ops/s

StringReplaceBenchmark.testFastStringReplaceShortStringOneMatch thrpt
21 15911221,949 ± 541064,693 ops/s
StringReplaceBenchmark.testStringUtilsReplaceShortStringOneMatch thrpt
21 10677897,475 ± 491091,973 ops/s

StringReplaceBenchmark.testFastStringReplaceShortStringSeveralMatches
thrpt 21 9271742,251 ± 220150,121 ops/s
StringReplaceBenchmark.testStringUtilsReplaceShortStringSeveralMatches
thrpt 21 6158829,188 ± 99637,607 ops/s
```
Pull Request #300: Improve StringUtils#replace throughput

14160 of 14870 relevant lines covered (95.23%)

12131.92 hits per line

Source Files on job 1009.1
  • Tree
  • List 0
  • Changed 13
  • Source Changed 1
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1009
  • Travis Job 1009.1
  • ca755688 on github
  • Prev Job for on master (#1008.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc