FYI, I'm seeing zero effect when playing around with these things in my 
code base (with or without NDBUG, and the various assert macro 
implementations.

I'm surprised though that the small asm.js is just 57 KByte uncompressed 
despite using iostreams, when I tested iostream stuff in my code it was 
always around 400 KByte like the big test case, and this was caused by all 
the iostream static initializers that were pulled in. Maybe something 
causes the iostream init code to be stripped away?

Cheers,
-Floh.

Am Dienstag, 18. Juli 2017 14:22:50 UTC+2 schrieb jj:
>
> Interesting test case. It looks like 
>
> #ifdef NDEBUG 
> #define    assert(x) (void)0 
> #else 
> #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, 
> __LINE__, __func__),0))) 
> #endif 
>
> is to blame here. If I change that to: 
>
> #ifdef NDEBUG 
> #define    assert(x) (__builtin_assume((x))) 
> #else 
> #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, 
> __LINE__, __func__),0))) 
> #endif 
>
> then I get small output also with NDEBUG defined. Can you verify the same? 
>
> 2017-07-18 14:51 GMT+03:00 Gaurav Dewan <[email protected] 
> <javascript:>>: 
> > Testcase here(all bcs, js makefile and gcc/clang generated exes): 
> > https://github.com/gauravdewan007/ndebug 
> > 
> > using -DNDEBUG helps to get rid of the assert (and save size and prevent 
> > strings from getting into the code). 
> > Both clang and gcc generate smaller binary if -DNEDBUG option is used. 
> > 
> > But using -DNDEBUG with emscripten build system causes a huge bloat in 
> size 
> > (irrespective of optimization level) and lot of new code is getting 
> added 
> > 
> > -- 
> > 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] <javascript:>. 
> > 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