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

jbhannah / amperize / 391
97%

Build:
DEFAULT BRANCH: master
Ran 10 Jun 2019 04:06AM UTC
Jobs 2
Files 1
Run time 1min
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

pending completion
391

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%)

36.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 391.1 10 Jun 2019 04:08AM UTC 0
100.0
Travis Job 391.1
2 391.2 10 Jun 2019 04:06AM UTC 0
100.0
Travis Job 391.2
Source Files on build 391
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #391
  • e09da2fc on github
  • Prev Build on master (#384)
  • Next Build on master (#393)
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