@@ -150,7 +150,7 @@ $ /usr/bin/time -v ./browsercore-get --dump http://127.0.0.1:1234/campfire-comme
150150## Multiple requests using Playwright
151151
152152We compare now multiple page loads and js evaluations using
153- [ Playwright] ( https://playwright.dev ) .
153+ [ Playwright] ( https://playwright.dev ) , which connects to the browser using CDP (Chrome Debug Protocol) .
154154
155155### Dependencies
156156
@@ -162,20 +162,34 @@ dependencies, mainly Playwright.
162162You have also to install [ Google Chrome] ( https://www.google.com/chrome/ ) and
163163Lightpanda browser, but the code is not publicly available yet.
164164
165- ### Google Chrome benchmark
165+ ### Running the benchmark
166166
167- We use Google Chrome version 123.0.6312.105.
168-
169- The ` playwright/chrome.js ` benchmark accepts multiple env vars to be configured.
170- * ` CHROME_PATH ` is the path to your Google Chrome bin,
171- * ` BASE_URL ` is the base url of the running web reser to request, by default ` http://127.0.0.1:1234 ` ,
167+ The ` playwright/cdp.js ` benchmark accepts multiple env vars to be configured.
168+ * ` BROWSER_ADDRESS ` is the address of the running browser listening the CDP protocol, by default ` http://127.0.0.1:9222 ` .
169+ * ` BASE_URL ` is the base url of the running web reser to request, by default ` http://127.0.0.1:1234 ` .
172170* ` RUNS ` is the number of pages loaded by the benchmark, default is ` 100 ` .
173171
174- ` npm run bench-chrome ` starts a playwright process, load a Google Chrome
172+ ` npm run bench-cdp ` starts a playwright process
175173instance and load the page to extract data 100 times.
176174
177175``` console
178- $ CHROME_PATH=` which google-chrome` npm run bench-chrome
176+ $ npm run bench-cdp
177+ ```
178+
179+ ### Results
180+
181+ ** Google Chrome**
182+
183+ We use Google Chrome version 123.0.6312.105.
184+
185+ You have to start the browser first.
186+ ``` console
187+ $ google-chrome --headless=new --disable-gpu --remote-debugging-port=9222
188+ ```
189+
190+ Then you can run the benchmark.
191+ ``` console
192+ $ npm run bench-cdp
179193
180194181195> node playwright/chrome.js
0 commit comments