top | item 42314941

(no title)

wis | 1 year ago

Amazing project!

> but also embeds v8 for a very small runtime instead of using Node.

By how much does embedding just V8 instead of using Node.js decrease the binary size? Node.js uses V8, does most of Node's binary size come from its runtime and not V8?

I tried browsing the website and GitHub repo to find how many kBs or MBs typically is a Window.js binary, but didn't find an answer.

discuss

order

silvajoao|1 year ago

See the binary sizes in the (obsolete) releases page:

https://github.com/windowjs/windowjs/releases

About 8 MiB in the end. Note that these builds have a binary trimmed by UPX.

wis|1 year ago

Wow, 8 MiB, that's impressively small IMO. I expected a program that embeds V8 (let alone also having windowing and Skia) to have a binary size much bigger. something closer to Node's or Deno's binary size 40MiB+.

Using the Window.js approach of embedding V8, instead of using a windowing library + a Skia Canvas library in Node.js ─really makes sense if you would like to keep the binary size minimally small and only pay for the libraries/modules you actually pull in and use, instead of having them statically linked in the binary by default. For example, an offline app/game that doesn't use the network doesn't need to have a "net" or "http" module in the binary. These may be bad examples though, I don't know how much do those Node runtime modules constitute out of the final Node binary, it may be an insignificant fraction.