4 ms·
Maybe a naive question but did you consider writing it in language that is typically faster (C++/Go/Rust)? I understand the many benefits of it being written in
by PudgePacket 9y ago
Maybe a naive question but did you consider writing it in language that is typically faster (C++/Go/Rust)? I understand the many benefits of it being written in JS but there is an inherent maximum level of performance that JS can achieve in certain workloads.
- thangngoc89 9y agoThere is an attempt to write JS module bundler in OCaml https://github.com/fastpack/fastpack https://github.com/fastpack/fastpack
- fenomas 9y agoMy naive answer, but I'd think that the heavy lifting for bundlers like this lies mostly in the external packages that parse and modify the code (Babel, uglify, postcss, etc). The core work of the bundler to wrangle which dependencies to pass to those external libraries probably isn't a performance bottleneck, surely?
- ioquatix 9y agoIn my experience you are not wrong. Resolving a build graph can be done efficiently. The main cost is typically the tools invoked to satisfy build targets. However, if the build graph does unnecessary work, it can slow the build down by a large amount, e.g. compiling files which were already compiled. In. a large project, it might be the difference between a 10 second build and a 10 minute build for example.
- merb 9y agowell at least there is a tool in java. and once warmed up it's basically the fastest tool available. google closure compiler. so basically if there would be a closure service that could be installed on your system a lot of things would be way faster.