That 4x size increase is also after a lot of ongoing performance engineering work. Now when you consider that eight years ago VS Code lacked features many would consider essential today-such as editor tabs or the built-in terminal-that increase is not perhaps as awful as it sounds, but it's not nothing either. For instance, one of VS Code's core JavaScript files ( workbench.js) is now around four times the size it was eight years ago. Although we put a lot of thought into what features we build into VS Code, over the years adding new functionality has necessarily grown the amount of code we ship. Unfortunately, these changes have almost always been increases. Actively monitoring code size keeps members of the VS Code team aware when it changes. Code size has become even more of a focus with VS Code shipping on web () in addition to the desktop application. This passion includes keeping the size of VS Code's JavaScript small. The VS Code team is passionate about performance, be that optimizing hot code paths, reducing UI re-layouts, or speeding up startup time. Name mangling is a neat trick, but may not be worth it in many codebases, and our specific approach to mangling can likely be improved on (or may not be necessary at all depending on how your project is built). I want to treat this more as a case study in how we approach engineering problems on the VS Code team rather than focusing on the specifics of mangling. In this post, I want to share how we identified this optimization opportunity, explored approaches to the problem, and eventually shipped this 20% size reduction. Instead all it took was a new build step: name mangling. Not too shabby considering we got this reduction without deleting any code and without any major refactorings in our codebase. Sure that's less than some of the individual gifs from our release notes, but that's still nothing to sniff at! Not only does this reduction mean less code you need to download and store on disk, it also improves startup time because less source code has to be scanned before the JavaScript is run. That works out to a little over 3.9 MB saved. Jby Matt Bierner, recently reduced the size of Visual Studio Code's shipped JavaScript by 20%. Node.js Development with Visual Studio Code and Azure.Moving from Local to Remote Development.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |