Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is this package actually for? #4

Open
drmrbrewer opened this issue Dec 11, 2017 · 3 comments
Open

What is this package actually for? #4

drmrbrewer opened this issue Dec 11, 2017 · 3 comments

Comments

@drmrbrewer
Copy link

Sorry for the dumb question but why is it useful to open multiple browser instances... is it any different to opening a single browser (with puppeteer.launch()) and using that to open multiple pages (with browser.newPage())? Is there a performance benefit of one way or the other? Wouldn't it be better to have a package for pooling pages instead? Or, since there isn't much overhead with opening and closing pages, unlike opening and closing a browser instance... don't even both with any page pool... just open/close pages as and when required?

@maxschmeling
Copy link

There are things where the separate processes are necessary for parallelization. The screenshot method is one.

@drmrbrewer
Copy link
Author

So screenshoting multiple pages of the same browser definitely doesn't happen in parallel? Doesn't the screenshoting of each page start in its own process... why should it have to happen in series?

@maxschmeling
Copy link

The internal implementation of the screenshot feature requires the browser to bring the tab being captured to the front / make it active. It then has to draw the page and then capture the image. If you're wanting to take multiple screenshots very quickly, you have to split it out into multiple processes so they can each be rendering a single page and not locking on the active page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants