Skip to content

Commit 3fe28d5

Browse files
committed
Optimize memory usage
The two bigger changes here are: 1- The http_client has been moved from the Session to the Browser, allowing its connection pool to be re-used across multiple sessions 2- The browser now has a page_arena which is used for all page-level allocation and which can be re-used between pages (currently retains 1MB of memory). Previously, pages uses an arena that was tied to the lifetime of the page, thus it could not be re-used. Using the Bench allocator for zig-js-runtime, allocated bytes went from 1347037879 to 834932438 (in a RUNS=1000 of puppeteer demo). Various other changes to try to simplify the API and remove the possibility of invalid states. For example, session.newPage() now includes the logic for page.start() so that there should now never be a page that wasn't started.
1 parent 43f42f9 commit 3fe28d5

File tree

6 files changed

+184
-204
lines changed

6 files changed

+184
-204
lines changed

0 commit comments

Comments
 (0)