1730 shaares
871 private links
871 private links
A very well written technical article on the optimization Bun takes to make npm install
fast. The set of techniques include reducing context switching (e.g. syscall, worker thread), using binary cache format to avoid json parse, dns prefetch, cache friendly data structures (like in ECS), ditch streaming decompression (cause buffer copies on allocation), use CoW syscalls for file copy, lock free parallelism.