Which version of gcc are you using? If you're not using the latest, then
the difference might be that emscripten does use a recent LLVM.

On Mon, Jul 27, 2015 at 3:28 PM, Mark Sibly <[email protected]> wrote:

> Ok, it appears em++ may be optimizing out some stuff that g++ isn't, as
> the em++ version is generating less garbage than the c++ version.
>
> I'm using -O3 for both em++ and g++, are there any other flags I can use
> in g++ to get similar optimizations?
>
> Bye,
> Mark
>
> On Tuesday, July 28, 2015 at 7:53:31 AM UTC+12, Mark Sibly wrote:
>>
>> Hi,
>>
>> I am working on a 'transpiler' style language that outputs c++, which I
>> then either compile as native code to produce desktop apps, or put through
>> emscripten to produce web apps.
>>
>> I've recently been working on the garbage collection stuff, and decided
>> to run a few speed tests as I have long been worried ask.js wouldn't be up
>> to this sort of thing.
>>
>> But much to my surprise, in many cases, the asm.js code runs *faster*
>> than the native code! I can tweak some GC settings so this isn't the case,
>> but with default settings asm.js is about 20% faster than the corresponding
>> native code.
>>
>> The test code is meaningless 'thrash the GC' sort of stuff so I'm not
>> taking the results too seriously yet, but I'm still a bit confused - how
>> can this be? What sort of voodoo is asm.js up to here?
>>
>> Also: does asm.js produce garbage if it's just running 'raw' code, ie: no
>> API calls?
>>
>> Bye!
>> Mark
>>
>>
>>
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to