Optimize for speed when rendering screenshots in Puppeteer and Chrome DevTools Protocol
Posted January 4, 2023 by Dmytro Krasun ‐ 1 min read
Let's talk about the optimizeForSpeed parameter introduced in Chrome DevTools Protocol which will soon be supported by Puppeteer or even supported now at the time when you are reading the post.
optimizeForSpeed option is introduced in
an update for Chromium, allows to use of faster encoding for images, and might increase the performance of taking screenshots by a lot.
Internally, the browser will use faster encoding for PNG, JPEG and WebP formats by restricting compression to
zlib q1, which is
Try the option yourself to see if it improves performance and doesn’t change the quality of your screenshots.
By the way, there is a few related articles you might be interested in: