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

Enable sampling profiler for bootup time attribution #9200

Closed
csabapalfi opened this issue Jun 14, 2019 · 7 comments
Closed

Enable sampling profiler for bootup time attribution #9200

csabapalfi opened this issue Jun 14, 2019 · 7 comments

Comments

@csabapalfi
Copy link
Contributor

Provide the steps to reproduce

  1. Run LH on https://lighthouse-script-module-attribution-a59aq0b77.now.sh/

What is the current behavior?

  • v8.moduleEvaluation script evaluation tasks are not attributed to URLs
  • bootup-time (Reduce JavaScript execution time) audit aggregates all module script execution under Other instead of showing URL breakdown

What is the expected behavior?

  • all script evaluation tasks (even for modules) are attributed to URLs
  • module URLs show up in the bootup-time audit instead of aggregated as Other

Environment Information

  • Affected Channels: CLI, Node, Extension, DevTools
  • Lighthouse version: 5.1.0 and before
  • Node.js version: 10.15.1
  • Operating System: macOS

Related issues
N/A

@csabapalfi csabapalfi changed the title core(bootup-time): v8.moduleEvaluation task has no URL attribution core(bootup-time): script type=module evaluation has no URL attribution Jun 14, 2019
@patrickhulce patrickhulce self-assigned this Jun 14, 2019
@csabapalfi
Copy link
Contributor Author

csabapalfi commented Jun 14, 2019

@patrickhulce agreed, this is more of a feature request. Thanks for labelling it correctly!

I looked in main-thread-tasks.js and then trace data (manually) from that minimal example I have linked.

This might not be straightforward to implement since I can see that the v8.moduleEvaluation event in the trace has no fileName arg (like v8.compileModule) and no data.url (like EvaluateScript or v8.compile).

@patrickhulce
Copy link
Collaborator

Yeah getting attribution for several of these remaining Other cases is going to be pretty tricky. My gut says we will need to enable the sampling profiler to solve them, but we'll see.

@patrickhulce patrickhulce changed the title core(bootup-time): script type=module evaluation has no URL attribution Enable sampling profiler for bootup time attribution Jun 25, 2019
@brendankenny
Copy link
Member

@patrickhulce can we merge this and #8526?

@patrickhulce
Copy link
Collaborator

Oh yeah there it is I thought we had one! @csabapalfi we'll merge this into #8526 as the same root fix, but thank you very much for the repro URL that will help implementation!

@csabapalfi
Copy link
Contributor Author

csabapalfi commented Jun 26, 2019

Thanks @patrickhulce!

Also I wonder if anything can be done in Chromium instead (assuming the sampling profiler is that expensive).

@radical-edo
Copy link

As mentioned here in this comment and since that issue has been closed and moved I'll just continue here :)

The problem is that I have a JS file that it takes about 20 ms to parse, but the scripting is 0ms. So it's quite a big file, but execution is nil, which I find quite suspicious. Most of what that file does, since it's bundled up from loads of smaller files and each file wraps its contents in an IIFE and registers to DOMContentLoaded event or uses jQuery's equivalent $(function() {}). After that the file will usually look for some DOM elements and if it finds them it would do it's thing. So the 0 ms scripting is really surprising. Any one would have some thoughts on this?

@csabapalfi
Copy link
Contributor Author

Actually this has been closed as well and the main issue tracking this is #8526

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

No branches or pull requests

4 participants