Re:Duetto: a C++ compiler for the Web going beyond Emscripte...
by angersock on Thursday October 31, 2013 @12:35PM
(#6647811)
From the link:
"Since I do not expect native platforms (i.e. GLibc) to preallocate gigs of memory at application startup to make it faster when dynamic memory is actually used, I do not expect this from a compiler for the JavaScript target either."
So, it would actually make very good sense to have the thing slab allocate a big honking array upfront, and then manage it with brk/sbrk/malloc, and perhaps just add more memory as needed.
Like, if we're going to be writing C/C++ in the browser, why not do this? Why make us deal with the GC at all?
Re:Duetto: a C++ compiler for the Web going beyond Emscripte...
by apignotti on Thursday October 31, 2013 @01:30PM
(#6648219)
I see your point. Still, I believe the browser environment is different from a console since it is not supposed to monopolize system resources while being used. Managing memory in smaller short lived chunks is more fair for the system as a whole.
Re:Duetto: a C++ compiler for the Web going beyond Emscripte...
by flohofwoe on Thursday October 31, 2013 @02:29PM
(#6648752)
Well, it's just about how much max memory you need at a time, no matter whether that size is split into many small chunks or allocated as a single block. True, an application which needs very little memory most of the time, and spikes to huge sizes from time to time is not optimal with emscripten's approach.
But I don't want to nitpick all day. The more options we have the better, keep up the good work :)
The perf comparison is missing a "asm.js + V8" bar, asm.js code is usually faster then non-asm.js code, even if the JS engine isn't implementing AoT compilation as FF does.
Edit: fixed "...uncommon -> common..." above