3 ms·
> Even at that level it's a lot of added code which means slower executable. Does it? Legitimate question. I would've assume that this could be almost entirely
by jjice 2y ago
> Even at that level it's a lot of added code which means slower executable.
Does it? Legitimate question. I would've assume that this could be almost entirely negligible depending on how the code is loaded into the runtime. If the code being loaded is only triggered when an import statement is seen, wouldn't that lead to essentially no speed overhead?
Even if it was statically linked in, I don't see why having the code would slow down the executable by any amount that we'd want to consider. Maybe literally more of an executable to load into memory, but I don't see that being a tangible slow down.
Would love to know if I'm missing a big piece here though.
- culi 2y agoAll modern build tools have pretty good tree shaking. If you don't use these features they should have basically no impact on your final build
- tmikaeld 2y agoNeither deno nor bun do tree shaking because they can’t make the same assumptions as front end code. They do cache the compiled code though, which makes some difference. But the reason S3 SDK is at least 5X slower than bun, is partly due to code size, since JavaScript always have to parse the code on every run. I worked 3 years on cloudflare workers and scripts even 1MB in size are slow and cpu intensive to run (before using it!). Now, even the most common auth for node with basic features is 20MB of scripting. That put a perspective on things like this.