lightpanda-io / browser

The open-source browser made for headless usage
https://lightpanda.io
GNU Affero General Public License v3.0
158 stars 1 forks source link

loop: add sleep between loop #281

Closed krichprollsch closed 1 week ago

krichprollsch commented 1 month ago

I used the benchmark on my own computer to compare a release build between main and this PR: main

$ npm run bench-puppeteer-cdp

> demo@1.0.0 bench-puppeteer-cdp
> node puppeteer/cdp.js

................................................................................
....................
total runs 100
total duration (ms) 25686
avg run duration (ms) 253
min run duration (ms) 187
max run duration (ms) 316

this PR

$ npm run bench-puppeteer-cdp

> demo@1.0.0 bench-puppeteer-cdp
> node puppeteer/cdp.js

................................................................................
....................
total runs 100
total duration (ms) 29046
avg run duration (ms) 287
min run duration (ms) 187
max run duration (ms) 332
krichprollsch commented 1 month ago

But we still use 3.2% of my CPU for doing nothing... image

francisbouvier commented 1 week ago

Closed in favor of https://github.com/lightpanda-io/browser/pull/302