-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Further optimize esbuild binary output #36453
Comments
updates
-- With (1) and (2) alone the diff between CC and esbuild is now 1.7% |
update
|
updates The table below shows current state, along with a few potential optimizations we could toggle on. Each individually is an incredibly mild improvement and bears some risk.
|
summary
As of the time of this writing, the closure compiled output is smaller than that created by esbuild.
There are four low hanging fruit that I believe can close the gap:
esbuild
does not do this due to a nuance with correctness. One simple solution is to rewrite our biggest offender,Services
to be all toplevel exported functions instead of static class functions. This shaves <0.5kb br, 5kb uncompressed> from esbuild output.pjs-promises
in particular is DCEd by closure but not by esbuild. This is another ~0.8kb br compressed.@enum
as opposed to forcing a property access. This is often smaller output as well. Unsure of size impact here.src/config
code is in every single binary, but only needs to be in Runtime.The text was updated successfully, but these errors were encountered: