2 ms·
"Firefox has open APIs for everything the browser does—a majority of Firefox “application” code is written in JavaScript." While it makes hacking on Firefox ea
by mikece 7y ago
"Firefox has open APIs for everything the browser does—a majority of Firefox “application” code is written in JavaScript."
While it makes hacking on Firefox easier, isn't this a liability for performance? Is this, perhaps, partly why WASM is such a focus for Mozilla?
- Ygg2 7y agoYeah, but when you look at it what is the alternative? To write the same thing as JS in Chromium, right?
- jraph 7y agoMy 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.
- paulintrognon 7y agoWhy is this question downvoted? I thought that was an interesting question.