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

Support perf metrics for web #101850

Closed
jrieken opened this issue Jul 7, 2020 · 10 comments
Closed

Support perf metrics for web #101850

jrieken opened this issue Jul 7, 2020 · 10 comments
Assignees
Labels
debt Code quality issues web Issues related to running VSCode in the web
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Jul 7, 2020

Goal is to have the ITimerService and the Performance View (F1 > Startup Performance) working for the web. Not all values we currently have apply but things like loading the the main bundle or digesting contributions does apply.

@jrieken jrieken self-assigned this Jul 7, 2020
@jrieken jrieken added the debt Code quality issues label Jul 7, 2020
@jrieken
Copy link
Member Author

jrieken commented Jul 7, 2020

with ea59ae2 and 2e802eb the timer service and the perf view is available in the web. What's missing is some critical perf marks to measure startup

@jrieken
Copy link
Member Author

jrieken commented Jul 7, 2020

@bpasero can you help me to get equivalent marks for willLoadWorkbenchMain and didLoadWorkbenchMain ( see here)

@jrieken jrieken added the web Issues related to running VSCode in the web label Jul 7, 2020
@jrieken jrieken added this to the July 2020 milestone Jul 7, 2020
@bpasero
Copy link
Member

bpasero commented Jul 7, 2020

@jrieken I would think that you can add didLoadWorkbenchMain here:

performance.mark('workbench-start');

As for willLoadWorkbenchMain the only solution I can think of is adding it into the script tag of the HTML before we load other scripts (this would not make them appear for Codespaces though as they have their own HTML entry file):

// NOTE: Changes to inline scripts require update of content security policy

and

// NOTE: Changes to inline scripts require update of content security policy

This needs tweaks to our CSP though (refs).

@jrieken
Copy link
Member Author

jrieken commented Jul 7, 2020

vscode/src/vs/code/browser/workbench/workbench.html

How does that case work? There is no require call in that one

@bpasero
Copy link
Member

bpasero commented Jul 7, 2020

I actually do not remember anymore, quite sure I did this together with @alexdima. Is that relevant, I think we just need to ensure to put the perf-start-marker as early as possible, no?

@alexdima
Copy link
Member

alexdima commented Jul 7, 2020

In the case of src/vs/code/browser/workbench/workbench.html, we use manual <script> tags to load the workbench, which is faster than creating script tags from the loader.js. The requests can be made in parallel by the browser as soon as the browser parses the .html and the evaluation still happens sequentially, but that is OK.

So if you want to know the time it takes to "require" workbench.main.js, I think you could try adding a <script> tag in the header and recording the Date.now() or perhaps use some special purpose HTML5 API -- https://www.html5rocks.com/en/tutorials/webperformance/basics/.

@jrieken
Copy link
Member Author

jrieken commented Jul 8, 2020

@alexdima where would I put the "after" mark? What's the signal that all of the workbench.main has been loaded?

@jrieken
Copy link
Member Author

jrieken commented Jul 8, 2020

What's the signal that all of the workbench.main has been loaded

nvm - figured that out

@jrieken
Copy link
Member Author

jrieken commented Jul 9, 2020

Adding renderer ready which is purely focused on the renderer and allows us to compare browser perf vs electron-renderer perf

Screenshot 2020-07-09 at 13 09 15

@jrieken jrieken closed this as completed Jul 9, 2020
@bpasero
Copy link
Member

bpasero commented Jul 9, 2020

@jrieken I like. I see that for web this is the very first entry in the HTML, but for desktop it is not. Shouldn't we put the renderer/started very high up into src/vs/code/electron-browser/workbench/workbench.html to compare the same thing?

@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues web Issues related to running VSCode in the web
Projects
None yet
Development

No branches or pull requests

3 participants