2 ms·
Looks like Evan Wallace ran into the same issue in practice in esbuild https://news.ycombinator.com/item?id=22336284 https://news.ycombinator.com/item?id=22336
by chubot 6y ago
Looks like Evan Wallace ran into the same issue in practice in esbuild
https://news.ycombinator.com/item?id=22336284 https://news.ycombinator.com/item?id=22336284
I actually originally wrote esbuild in Rust and Go, and Go was the clear winner.
The parser written in Go was both faster to compile and faster to execute than the parser in Rust. The Go version compiled something like 100x faster than Rust and ran at something around 10% faster (I forget the exact numbers, sorry). Based on a profile, it looked like the Go version was faster because GC happened on another thread while Rust had to run destructors on the same thread.
ESBuild is a really impressive performance-oriented project:
https://github.com/evanw/esbuild https://github.com/evanw/esbuild
The Rust version also had other problems. Many places in my code had switch statements that branched over all AST nodes and in Rust that compiles to code which uses stack space proportional to the total stack space used by all branches instead of just the maximum stack space used by any one branch: https://github.com/rust-lang/rust/issues/34283 https://github.com/rust-lang/rust/issues/34283
(copy of lobste.rs comment)