3 ms·
For much, NaCl has a 2x perf penalty (v. native C++), and PNaCl higher (compilation overhead, and compilation has a higher cost: delaying runtime from starting)
by gsnedders 14y ago
For much, NaCl has a 2x perf penalty (v. native C++), and PNaCl higher (compilation overhead, and compilation has a higher cost: delaying runtime from starting). asm.js already, despite being brand-new, for much has a 2x perf penalty: equal with NaCl, yet more portable. (See zlib, for an example of this.)
There are still cases where asm.js is slower (box2d, for example, though there it's broken JS through the point needed for 60fps), but I'd expect nothing but the difference to decrease. Unlike PNaCl, it's not mere research (after several years it's still not shipped), works cross-browser, and further unlike NaCl, works cross-platform.
I expect someone will write some binary serialization for asm.js: you have all the primitives for iadd, isub, etc.
- haberman 14y ago> For much, NaCl has a 2x perf penalty (v. native C++) Huh? From the NaCl paper: "The worst case performance overhead is crafty at about 12%, with other benchmarks averaging about 5% overall." How do you get from 5% to 2x (100%)? > asm.js already, despite being brand-new, for much has a 2x perf penalty: equal with NaCl Have you actually run the same benchmarks on both and found them equal? According to this comment no such benchmarks have been performed yet (at least by azakai): http://news.ycombinator.com/item?id=5228737 http://news.ycombinator.com/item?id=5228737 If not, declaring it "equal" seems a bit premature.