Terrence Cole wrote:
The performance of the web is vital. With gaming and video as first-class citizens, we have to consider both the throughput and latency of the GC as priorities. Any added complexity in the GC will either directly make the web slower or will disproportionately divert our energy from making other things faster.
Excellent point, and of course native-uber-alles devs object to GC on this basis (http://sealedabstract.com/rants/why-mobile-web-apps-are-slow/).
So far, and certainly for V8 and the V8 and then Octane benchmarks, throughput is the only measured good, if either of throughput and latency can be said to be directly benchmarked. Latency needs benchmarks!
Let's say game developers tend toward C++/OpenGL for good reasons (mainly cross-platform portability + best perf), and Emscripten+asm.js (with JS evolving to keep asm.js a subset) are "enough". No GC there.
Then there are still cases where GC latency matters, of course. Even with C++/OpenGL, there may be cases where the developer or our target runtime wants to mix "host" (JS GC-heap allocated) objects and "guest" (asm.js's typed array) objects. And of course, there's gmail.
At JSConf.eu, John McCutchan of Google and a colleague who works on gmail gave a good talk on GC, showing off Chrome's memory profiling tool. They showed historical plots revealing gmail bugs, V8 GC regressions, all the interesting dirt. Their tooling is great, I think dcamp and team are on the case. But when they called on JS developers to manage GC pause time, they lost me.
How are JS developers supposed to manage pause time, even indirectly (by avoiding unnecessary allocations and fixing leaks)? There's no way. We won't be adding manually callable gc() built-ins to the standard.
While some want requestAnimationFrame to keep the GC at bay (is this doable), in general the developer should not have to hint or beg the JS VM for lower latency or (really) no sudden loss of 60fps soft realtime guarantees.
So +1 for giving latency a boost in GC design and benchmarking. I write this acknowledging your point about weak refs going against this goal. But perhaps we can have both, in their proper relation (pause-free GC out of the box for code that doesn't use certain features, especially for those gmail-to-game apps; others pay as they buy trouble by the yard).
/be _______________________________________________ dev-tech-js-engine-internals mailing list dev-tech-js-engine-internals@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals