-
Notifications
You must be signed in to change notification settings - Fork 9k
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
[Bug]: The page.goto is extremely slow when specifying headless: 'new'. #10758
Comments
The issue has been labeled as confirmed by the automatic analyser. |
I am not able to reproduce. As the goto method waits for the page to load, are you sure the delay is not caused by unstable internet connection? or perhaps something else blocking the load process?
|
Thank you for your reply. |
I have also tried on M1 Mac and it does not reproduce. |
Thank you for your reply. Below is the investigation log.
|
Rosetta is known to be slow as it's an emulation mode. I guess there is a mismatch between cpu architectures in the binaries, for example, we have no arm64 binaries for linux. |
Ah, sorry, I incorrectly assumed Docker is used here. |
Is it possible to turn off Rosetta? |
FYI in Lighthouse we detect the rosetta case (using x64 node to launch chrome results in launching x64 chrome under rosetta emulation, instead of the arm64 chrome in the universal app bundle...) and throw an error, as the performance hit is substantial: GoogleChrome/lighthouse#14288 Chrome has since added a error message in the logs to call out this scenario: https://bugs.chromium.org/p/chromium/issues/detail?id=1305353 Perhaps Puppeteer could do something similar. |
I turn off Rosetta and installed Node for arm64. After that, I resolved the issue by reinstalling puppeteer. Thank you for your response and advice. I appreciate it. |
Thanks, @connorjclark, I think we should do the same. |
I am not sure what is happening here, but it seems like there is a performance issue with version 21.1.0. In our case, tests are taking more or less twice as long with 21.1.0 than with 21.0.0, this happens on freshly generated docker runners in a cloud environment (arm64 architecutre for sure!). Switching versions in our setup makes this 100% reproducible... |
I had the same issue when loading local pages. It turned out it couldn't find a page resource (an image), which was causing the delay. I simply corrected the local path to my image, and it worked. I'm not familiar with how Puppeteer works, but this fixed the problem for me. It went from 22 seconds to 1 second. |
thx~ |
Minimal, reproducible example
Error string
no error
Bug behavior
Background
After upgrading the puppeteer version from 19.11.0 to 21.1.0, the execution speed of page.goto has become significantly slower.
Below are the results of comparing the execution speed of the above code for each version. The speed has become slower as the version has increased.
puppeteer:19.11.0
goto: 1.374s
puppeteer:20.0.0
goto: 6.363s
puppeteer:21.1.0
goto: 14.259s
Expectation
I expect the page.goto to complete within 2 seconds.
Reality
The execution of page.goto takes more than 10 seconds.
Puppeteer configuration file (if used)
No response
Puppeteer version
21.1.0
Node version
v16.14.2
Package manager
npm
Package manager version
8.5.0
Operating system
macOS
The text was updated successfully, but these errors were encountered: