How are code changes affecting the size of the Deno binary?

scarf on the Deno Discord had this question:

Are there any guides to building a 'stripped-down' version of deno from source? for example, i'd like to build a deno binary that runs typescript files but other additional features like check, fmt, jupyter, lsp removed. this would be useful to reduce binary size in docker container

I figured the addition of Jupyter code was pretty small (main new requirement is zeromq, the rest is all protocols that Jupyter handles). To test that hypothesis, I calculated the Deno size between Linux canaries from dl.deno.land.

Methodology

Size of the Deno Canary on Linux over time (in commits)

Commits that contain Jupyter related changes are in orange

6Aug1320273Sep1017241Oct815authoredDate →0 MB4.77 MB9.54 MB14.31 MB19.07 MB23.84 MB28.61 MB33.38 MB38.15 MB↑ size

Conclusion

The Jupyter additions don't appear to have added much to the size, relative to the overall size of the binary. More investigation is needed to determine how much LSP and Chrome Devtools add to the binary. However, these development tools are not part of running a standalone server. The Jupyter bits for instance are only executed if and when deno jupyter is invoked. The same goes for REPL and LSP bits.

Then again, if someone really has the desire to maintain a whole 'nother copy of Deno you can:

Happy Hacking!