3 ms·
My intuition is that most of the code for which performance really matters is written in Rust and C++ (the web engine, Gecko, and the Javascript engine, SpiderM
by jraph 7y ago
My intuition is that most of the code for which performance really matters is written in Rust and C++ (the web engine, Gecko, and the Javascript engine, SpiderMonkey).
- kllrnohj 7y agoI personally consider UI responsiveness to also be something that really matters. It's great that part of the UI handling code is fast, but that doesn't mean all of it shouldn't be fast.
- kevingadd 7y agoWhen it comes to responsiveness, raw compute throughput (the thing you get most out of say, vectorized C++) is not especially important. You care about latency and JavaScript can provide good latency if it's been JITted. If part of your flow is already in JavaScript, porting more to JS can actually improve latency because it cuts native<->JS transitions out of the call stack, so you're running less code in total even if the code you run is a bit slower (due to being JS instead of C++). In general Chrome and Firefox have both moved a lot of stuff from C++ to JS (this is referred to as 'self-hosting') because it allows inlining across more calls and eliminates native<->JS transition overhead.