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

Improve extension startup performance #408

Merged
merged 4 commits into from
Aug 13, 2022

Conversation

DaelonSuzuka
Copy link
Collaborator

Following the Microsoft documentation here, I rebuilt the extension's compilation pipeline to use a bundling tool called esbuild. This tool shoves all the javascript in the entire project into a single file, which sounds like a terrible idea until you look at this extension host profiler flame graph:

Details

image

500+ms of almost nothing but module importing.

The highest startup time I saw tonight, on my machine was 650ms, and after bundling I'm averaging around 85ms. I have a user that's reported 1400ms startups, and the dev build I sent him cut that down to 630ms.

This cuts the compiled extension down from 796 files and 1.34MB, to 348 files and 295.19KB.

Additionally, this tool does some different linting, which revealed some warnings that I fixed. This extension now compiles with no warnings! (for now...)

@DaelonSuzuka
Copy link
Collaborator Author

I came back to add an edit saying that I didn't update the CI yet, but I decided to check it first:

image

.vscodeignore Outdated Show resolved Hide resolved
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton!

@Calinou Calinou merged commit cf432a1 into godotengine:master Aug 13, 2022
@DaelonSuzuka DaelonSuzuka deleted the extension-performance branch August 22, 2022 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants