What takes up space in deno? #9811
Replies: 7 comments 8 replies
-
I think this is a very interesting question:
The actual bare minimum code required for us to execute JS (without TS support) is 32.7 MB on linux (see denort in filesize benchmark here: https://deno.land/benchmarks#executable-size). Compared to Node we are doing very well. Node.js is 92.7 MB on Linux (v15.6.0 downloaded from https://nodejs.org/en/), and does not contain a built in linter, formatter, doc generator, coverage tool, typescript compiler and package manager. Just the Deno runtime (without tooling) is about 2.8x smaller than all of Node. Even Deno with all of its built in tooling is still 1.75x smaller than Node. |
Beta Was this translation helpful? Give feedback.
-
Deno's been growing and I've been trying to distribute as-small-as-possible I think it's ICU data and WebGPU? @lucacasonato do you know if that's what the jumps in the graph are from? I found 0cf952e which shows a 10MB ICU data payload. I read through an article about reducing Rust binary size but learned that Deno has already enabled those size optimizations. So I'll post some findings on stripping the binaries and using
Doesn't tell me much but it looks like V8 is now less than the previously mentioned size of 10-15MB. Stripping the binaries produces a 38MB executable for Linux, which is great:
|
Beta Was this translation helpful? Give feedback.
-
if we talk about the exe file size of |
Beta Was this translation helpful? Give feedback.
-
Deno also embeds ICU data (>10 MB) unconditionally: https://github.com/denoland/deno_core/blob/93f62f0fa2b58d781c3bd80a5abb2d94de26233b/core/runtime/jsruntime.rs#L328 Just the |
Beta Was this translation helpful? Give feedback.
-
As of today, on my linux box, deno weighs 107M against 52M for node. That is uncomfortably large for |
Beta Was this translation helpful? Give feedback.
-
I liked the single binary approach of deno from the start. |
Beta Was this translation helpful? Give feedback.
-
I know that windows binaries can be a lot bigger than linux ones (deno.exe is about 98MB as of v1.45.5) I did some testing for one of my projects and it is cheaper to have the bundled JS (<10kB) and a copy of the full Deno runtime separately, because deno compile emits a ~280MB file. This is far behind the claims of the Deno 1.42 blog post. It doesnt look right to me that the output file is more than twice as big as bundled code + runtime. Does this include a v8 context snapshot? If that is the case it would be great to have an option to control this. |
Beta Was this translation helpful? Give feedback.
-
Genuine question, want to understand.
Js in WASM (4mb): https://github.com/mbbill/JSC.js
Stand-alone WASM runtime (4mb): https://github.com/bytecodealliance/wasmtime
There’s clearly a heap of functionality missing when comparing JS in a standalone WASM runtime to Deno. My naive question is this, what features make up the difference in binary size? Is it mostly file and network IO?
Beta Was this translation helpful? Give feedback.
All reactions