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

[Bug]: 30-50% performance drop since v19.7.1 #9993

Closed
2 tasks
feesler opened this issue Apr 6, 2023 · 3 comments · Fixed by #10002
Closed
2 tasks

[Bug]: 30-50% performance drop since v19.7.1 #9993

feesler opened this issue Apr 6, 2023 · 3 comments · Fixed by #10002
Assignees
Labels
bug confirmed disable-analyzer Disables the automatic workflow that tries to reproduce bug reports

Comments

@feesler
Copy link

feesler commented Apr 6, 2023

Bug expectation

Similar to #8650 but not so dramatic.

Steps to reproduce the problem:

  1. Install puppeteer v19.7.0 dependency
  2. import puppeteer from 'puppeteer';
  3. Run some script and measure performance
  4. Update puppeteer to v19.7.1 and repeat step 3

Updated https://github.com/feesler/puppeteer-perf package to test this issue.
Script will download Chromium revision 1095492 to discard possible difference in browser performance.
Try to run several times to avoid caching effects or give URL with more elements on page.

Bug behavior

  • Flaky
  • PDF

Minimal, reproducible example

git clone https://github.com/feesler/puppeteer-perf.git
cd puppeteer-perf
npm install
npm test
npm install puppeteer@19.7.1
npm test

Error string

no error

Puppeteer configuration

No response

Puppeteer version

19.8.5

Node version

19.8.1

Package manager

npm

Package manager version

8.13.2

Operating system

Windows

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

This issue was not reproducible. Please check that your example runs locally and the following:

  • Ensure the script does not rely on dependencies outside of puppeteer and puppeteer-core.
  • Ensure the error string is just the error message.
    • Bad:

      Error: something went wrong
        at Object.<anonymous> (/Users/username/repository/script.js:2:1)
        at Module._compile (node:internal/modules/cjs/loader:1159:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
        at Module.load (node:internal/modules/cjs/loader:1037:32)
        at Module._load (node:internal/modules/cjs/loader:878:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
        at node:internal/main/run_main_module:23:47
    • Good: Error: something went wrong.

  • Ensure your configuration file (if applicable) is valid.
  • If the issue is flaky (does not reproduce all the time), make sure 'Flaky' is checked.
  • If the issue is not expected to error, make sure to write 'no error'.

Once the above checks are satisfied, please edit your issue with the changes and we will
try to reproduce the bug again.


Analyzer run

@OrKoN OrKoN added disable-analyzer Disables the automatic workflow that tries to reproduce bug reports confirmed and removed needs-feedback not-reproducible labels Apr 7, 2023
@OrKoN
Copy link
Collaborator

OrKoN commented Apr 7, 2023

@jrandolf ptal, it is probably the new selector querying engine. I think 30-50% is too much so perhaps there is a bug (or generators are that much slower in Node just like ESM imports were last time).

@jrandolf
Copy link
Contributor

jrandolf commented Apr 11, 2023

This depends on how many elements are being queried. We typically batch queried elements with a default size of 20 which may be why this query takes so long (there are 120~ elements). I've amortized the logic related to this so the performance should be fixed. (It will still be about ~8-10% slower, but this is expected because of some new logic we've built into puppeteer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed disable-analyzer Disables the automatic workflow that tries to reproduce bug reports
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants