top | item 33442938

(no title)

notriddle | 3 years ago

Yes, you technically can write high-perf JavaScript code...

https://github.com/alangpierce/sucrase/blob/153fa5bf7603b9a5...

But freaking SIGH I don't want to. I prefer coding in environments that don't require unrolling loops by hand.

discuss

order

masklinn|3 years ago

There was a back and forth on that subject a few years back: Mozilla rewrote their sourcemap parser from JS to naïve Rust (/WASM) for a 5.89x gain, mraleph objected to the need and went through an epic bout of algorithmic and micro-optimisations to get the pure JS to a similar level, then the algorithmic optimisations were reimported into the Rust version for 3x further gain (and much lower variance than the pure JS).

https://hacks.mozilla.org/2018/01/oxidizing-source-maps-with...

https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to...

https://fitzgeraldnick.com/2018/02/26/speed-without-wizardry...