Skip to content

Commit a709212

Browse files
committed
update the benchmark using puppeteer
1 parent 653a541 commit a709212

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,33 +147,34 @@ $ /usr/bin/time -v ./browsercore-get --dump http://127.0.0.1:1234/campfire-comme
147147
Exit status: 0
148148
```
149149

150-
## Multiple requests using Playwright
150+
## Multiple requests using Puppeteer
151151

152152
We compare now multiple page loads and js evaluations using
153-
[Playwright](https://playwright.dev), which connects to the browser using CDP (Chrome Debug Protocol).
153+
[Puppeteer](https://https://pptr.dev/), which connects to the browser using CDP
154+
(Chrome Debug Protocol).
154155

155156
### Dependencies
156157

157158
To run the benchmark, you need ti install [nodejs](https://nodejs.org/en/download).
158159

159160
Once `nodejs` is installed, please run a `npm install` to install nodejs
160-
dependencies, mainly Playwright.
161+
dependencies, mainly Puppeteer.
161162

162163
You have also to install [Google Chrome](https://www.google.com/chrome/) and
163164
Lightpanda browser, but the code is not publicly available yet.
164165

165166
### Running the benchmark
166167

167-
The `playwright/cdp.js` benchmark accepts multiple env vars to be configured.
168+
The `puppeteer/cdp.js` benchmark accepts multiple env vars to be configured.
168169
* `BROWSER_ADDRESS` is the address of the running browser listening the CDP protocol, by default `http://127.0.0.1:9222`.
169170
* `BASE_URL` is the base url of the running web reser to request, by default `http://127.0.0.1:1234`.
170171
* `RUNS` is the number of pages loaded by the benchmark, default is `100`.
171172

172-
`npm run bench-playwright-cdp` starts a playwright process
173+
`npm run bench-puppeteer-cdp` starts a Puppeteer process
173174
instance and load the page to extract data 100 times.
174175

175176
```console
176-
$ npm run bench-playwright-cdp
177+
$ npm run bench-puppeteer-cdp
177178
```
178179

179180
### Results
@@ -189,18 +190,18 @@ $ google-chrome --headless=new --remote-debugging-port=9222
189190

190191
Then you can run the benchmark.
191192
```console
192-
$ npm run bench-playwright-cdp
193+
npm run bench-puppeteer-cdp
193194

194-
> [email protected] bench-playwright-cdp
195-
> node playwright/cdp.js
195+
> [email protected] bench-puppeteer-cdp
196+
> node puppeteer/cdp.js
196197

197198
................................................................................
198199
....................
199200
total runs 100
200-
total duration (ms) 18792
201-
avg run duration (ms) 184
202-
min run duration (ms) 168
203-
max run duration (ms) 323
201+
total duration (ms) 23637
202+
avg run duration (ms) 233
203+
min run duration (ms) 207
204+
max run duration (ms) 298
204205
```
205206

206207
![aws.m5 Playwright with Google Chrome](./img/aws_m5_playwright_chrome.png)

0 commit comments

Comments
 (0)