prettier-vscode icon indicating copy to clipboard operation
prettier-vscode copied to clipboard

Extension has grown quite a bit in size

Open jasonwilliams opened this issue 4 years ago • 1 comments

Summary

I've noticed Prettier extension seems much more time compared to other extensions, i was curious, considering I already had Prettier installed why it needed to do so much?

Here is the performance Start up diagnostics.

| Extension                           | Eager | Load Code | Call Activate | Finish Activate | Event                             | By                                  |
| ----------------------------------- | ----- | --------- | ------------- | --------------- | --------------------------------- | ----------------------------------- |
| vscode.debug-auto-launch            | true  | 3         | 0             | 6               | *                                 | vscode.debug-auto-launch            |
| vscode.git                          | true  | 35        | 5             | 26              | *                                 | vscode.github                       |
| vscode.github                       | true  | 4         | 1             | 0               | *                                 | vscode.github                       |
| vscode.npm                          | true  | 18        | 1             | 151             | workspaceContains:package.json    | vscode.npm                          |
| EditorConfig.EditorConfig           | true  | 6         | 0             | 1               | *                                 | EditorConfig.EditorConfig           |
| GitHub.vscode-pull-request-github   | true  | 47        | 1             | 37              | *                                 | GitHub.vscode-pull-request-github   |
| mhutchie.git-graph                  | true  | 10        | 3             | 23              | *                                 | mhutchie.git-graph                  |
| vscode.configuration-editing        | false | 6         | 0             | 1               | onLanguage:json                   | vscode.configuration-editing        |
| vscode.emmet                        | false | 9         | 11            | 62              | onStartupFinished                 | vscode.emmet                        |
| vscode.extension-editing            | false | 10        | 1             | 2               | onLanguage:markdown               | vscode.extension-editing            |
| vscode.github-authentication        | false | 4         | 0             | 3               | onAuthenticationRequest:github    | vscode.github-authentication        |
| vscode.json-language-features       | false | 31        | 1             | 8               | onLanguage:json                   | vscode.json-language-features       |
| vscode.markdown-language-features   | false | 31        | 2             | 0               | onLanguage:markdown               | vscode.markdown-language-features   |
| vscode.markdown-math                | false | 4         | 0             | 9               | api                               | vscode.markdown-language-features   |
| vscode.merge-conflict               | false | 2         | 1             | 61              | onStartupFinished                 | vscode.merge-conflict               |
| vscode.microsoft-authentication     | false | 4         | 0             | 49              | onAuthenticationRequest:microsoft | vscode.microsoft-authentication     |
| vscode.typescript-language-features | false | 26        | 90            | 2               | onLanguage:javascript             | vscode.typescript-language-features |
| alefragnani.Bookmarks               | false | 3         | 1             | 3               | onStartupFinished                 | alefragnani.Bookmarks               |
| codespaces-contrib.codeswing        | false | 62        | 1             | 1               | onStartupFinished                 | codespaces-contrib.codeswing        |
| dbaeumer.vscode-eslint              | false | 15        | 1             | 60              | onStartupFinished                 | dbaeumer.vscode-eslint              |
| eamodio.gitlens                     | false | 61        | 1             | 112             | onStartupFinished                 | eamodio.gitlens                     |
| esbenp.prettier-vscode              | false | 266       | 58            | 15              | onStartupFinished                 | esbenp.prettier-vscode              |
| jasew.anki                          | false | 79        | 9             | 0               | api                               | vscode.markdown-language-features   |
| matklad.rust-analyzer               | false | 43        | 6             | 6664            | onLanguage:rust                   | matklad.rust-analyzer               |
| ms-vscode-remote.remote-containers  | false | 74        | 1             | 236             | onStartupFinished                 | ms-vscode-remote.remote-containers  |
| vadimcn.vscode-lldb                 | false | 8         | 1             | 14              | onStartupFinished                 | vadimcn.vscode-lldb                 |

There's some time being spent inside of "Load Code" so maybe the output has expanded somewhat.

When checking the distributed extensions I noticed v3.3.2 from 2019 was only 10.8MB where as v9.0.0 from 2021 is 36.2MB This is a bit of a jump.

Looking at the distributed output I can see that the web-extension is quite large. Is this because it statically-links prettier itself? I wonder if there's a way for the desktop version not to incorporate this?

I also noticed sourcemaps. These sourcemaps are quite big and may not be needed in the final distribution. the web-extension.map file is 11MB. Maybe this could be removed on production versions as this file is bigger than some extensions. I think here could check for production mode. If debugging is needed this could be done on a checked-out version.

Maybe bring up the minimum ES age too to reduce polyfill code being generated? As of Node.js 14.0.0, 100% of ES2020 is supported and seeing that you have a minimum version of 1.60.0 you could bring this up to ES2020 here and here.

jasonwilliams avatar Nov 22 '21 22:11 jasonwilliams

Great ideas, would you be willing to send a pull request?

ntotten avatar Nov 23 '21 03:11 ntotten

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Dec 23 '22 00:12 github-actions[bot]