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

mathiasbynens / esrever / 46 / 2
81%
master: 81%

Build:
DEFAULT BRANCH: master
Ran 12 Feb 2018 12:56PM UTC
Files 1
Run time 0s
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 Feb 2018 12:53PM UTC coverage: 80.769%. Remained the same
46.2

push

travis-ci

mathiasbynens
Build up result in array instead of strings

Incrementally concatenating strings means a lot of intermediate strings get allocated only to be thrown away. The result is O(n**2) in both space and time. See this post about “Shlemiel the painter’s algorithm” for a good description about the quadratic behavior involved: https://www.joelonsoftware.com/2001/12/11/back-to-basics/

Storing each fragment in an array and joining them all together in the end at least avoids allocating ever-longer intermediate strings. I have not run any benchmarks on very long strings,
though. That might still be interesting to do.

Closes #12.

16 of 25 branches covered (64.0%)

21 of 26 relevant lines covered (80.77%)

32.38 hits per line

Source Files on job 46.2
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 46
  • Travis Job 46.2
  • 14b34013 on github
  • Prev Job for on master (#45.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