6 ms·
Running a blank .js file in node took 66 milliseconds. An optimized binary I wrote in rust takes 2 milliseconds to execute. So, I think there's a cap there on h
by showsomerespect 2y ago
Running a blank .js file in node took 66 milliseconds. An optimized binary I wrote in rust takes 2 milliseconds to execute. So, I think there's a cap there on how fast JavaScript tools can be
- WorldMaker 2y agoThis is addressed in the article. Node doesn't cache an JS compilation data by default. There's an environment flag to turn that on, and the startup time drastically reduces with it on (on the second+ run of the file). Also both Deno and Bun have more optimized startup times in general by default, some of that startup time is just Node, not a reflection of the language itself.
- Alifatisk 2y agoWhich env flag are you referring to? "--experimental-vm-modules"? Or maybe "--experimental-policy"?
- WorldMaker 2y ago`export NODE_COMPILE_CACHE=~/.cache/nodejs-compile-cache`
- Alifatisk 2y agoHad no idea about this, thanks!