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

jbhannah / amperize / 391 / 1
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 10 Jun 2019 04:08AM 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

10 Jun 2019 04:05AM UTC coverage: 100.0%. Remained the same
391.1

push

travis-ci

AileenCGN
🚀 Process img tags in parallel before sequential traversal

no issue

Switching to `probe-image-size` dramatically cut the time spent fetching images and the amount of network traffic used when calculating image dimensions but we were still performing requests sequentially which is really slow. This commit takes advantage of `async.parallel` to run up to 10 requests at a time to make better use of the available network capacity.

- move img tag handling out of the sequential traversal loop
  - use `domutils` to pull out an array of img elements for processing
  - create an async task for processing each img element
  - use `async.parallelLimit` to process 10 img tasks at a time

Continuation of performance testing using the same example content for the previous `probe-image-size` commit...

```
image-size only:
INFO amp.parse http://ghost.blog/2019/06/08/test/ 52278ms
INFO amp.parse http://ghost.blog/2019/06/08/test/ 52717ms
INFO amp.parse http://ghost.blog/2019/06/08/test/ 50582ms

average: 51,859ms

probe-image-size w/ image-size fallback:
INFO amp.parse http://ghost.blog/2019/06/08/test/ 11147ms
INFO amp.parse http://ghost.blog/2019/06/08/test/ 12297ms
INFO amp.parse http://ghost.blog/2019/06/08/test/ 11188ms

average: 11,544ms
speedup: ~4.5x

parallel image fetch before traversal:
INFO amp.parse http://ghost.blog/2019/06/08/test/ 1629ms
INFO amp.parse http://ghost.blog/2019/06/08/test/ 1744ms
INFO amp.parse http://ghost.blog/2019/06/08/test/ 1398ms

average: 1,590ms
speedup: ~7.2x

total speedup: ~32.5x
```

8 of 8 branches covered (100.0%)

17 of 17 relevant lines covered (100.0%)

18.0 hits per line

Source Files on job 391.1
  • Tree
  • List 0
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 390
  • Travis Job 391.1
  • e09da2fc on github
  • Prev Job for on master (#384.1)
  • Next Job for on master (#393.2)
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