Hi Mark, If you do that, the output will be roughly the same, but any atomic accesses you have would still use the atomic instructions. My understanding is that V8 at least uses the same codegen for atomic instructions no matter whether the memory is shared or not, so those atomic accesses would be slower than normal loads and stores. In principle V8 could optimize to use non-atomic loads and stores in this case, but I don't think it does. Compiling with threads enabled might also inhibit some optimizations around those atomic accesses that LLVM would have been able to do otherwise.
If you do end up trying this out, I would be very curious to hear what the overhead ends up being. Best, Thomas On Wed, Sep 21, 2022 at 7:23 PM Mark Sibly <[email protected]> wrote: > Hi, > > Does anyone have any idea what the overhead of using the -pthread compiler > option is? > > If I'm writing a simple single thread app, is it OK to just leave this on > for all compilation units, but link the final exe without either -pthread > or -sPTHREAD_POOL_SIZE? Would this give roughly the same output as > compiling everything without -pthread? > > 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]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/40ce5767-d11d-4e7e-b44a-247137524b57n%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/40ce5767-d11d-4e7e-b44a-247137524b57n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAJZD_EWKYUgXAfOXFBYLFG384ciWN_DFjDmP%2B0MvtETrkWHrHA%40mail.gmail.com.
