Forwarding a reply from Luke Wagner, who mentioned the message to the
mailing list bounced for him, not sure if it reached the mailing list, see
below.

On Tue, Mar 14, 2017 at 3:37 PM, Luke Wagner <lwag...@mozilla.com> wrote:
> Safari doesn't validate asm.js, so you're just seeing normal JIT
optimizations.  Firefox also has JIT optimizations for Atomics, so perhaps
there's just something going wrong in this case; it'd be good to file a bug
with a test case so we can see what's going wrong.  (Last I heard,
Chrome/Edge don't optimize Atomics-in-asm.js either, but I could be wrong
or out of date.)


2017-03-14 22:37 GMT+02:00 Luke Wagner <lwag...@mozilla.com>:

> Safari doesn't validate asm.js, so you're just seeing normal JIT
> optimizations.  Firefox also has JIT optimizations for Atomics, so perhaps
> there's just something going wrong in this case; it'd be good to file a bug
> with a test case so we can see what's going wrong.  (Last I heard,
> Chrome/Edge don't optimize Atomics-in-asm.js either, but I could be wrong
> or out of date.)
>
> On Tue, Mar 14, 2017 at 1:22 PM, Jukka Jylänki <juj...@gmail.com> wrote:
>
>> Yeah, this is a peculiar situation. The requirement for an environment
>> variable in Firefox was the expectation that other browsers would not ship
>> support for asm.js based multithreading with SharedArrayBuffer, so Firefox
>> would be the only one that'd have it. Now it seems that other browsers are
>> indeed shipping it(?), so Firefox is the one with slow asm.js support?
>>
>> 2017-03-12 23:47 GMT+02:00 Alon Zakai <alonza...@gmail.com>:
>>
>>>
>>>
>>> On Sun, Mar 12, 2017 at 2:20 PM, Brion Vibber <br...@pobox.com> wrote:
>>>
>>>> On Sun, Mar 12, 2017 at 1:55 PM, Alon Zakai <alonza...@gmail.com>
>>>> wrote:
>>>>
>>>>> Searching for that error string in the source, looks like there have
>>>>> been some changes to the prefs,
>>>>>
>>>>> https://bugzilla.mozilla.org/show_bug.cgi?id=1299359
>>>>>
>>>>> So now you'll need to set asmjs.atomics.enable for it to validate as
>>>>> asm.js.
>>>>>
>>>>
>>>> This appears to need to be set via an environment variable instead of a
>>>> pref, ick. :(
>>>>
>>>>
>>> It seems that in discussion in that link, they decided to add both an
>>> env var and a pref. asmjs.atomics.enable is the pref I believe.
>>>
>>>
>>>> Ok, if I set it, the multithreaded performance is *great* in Firefox.
>>>> :) So that explains that at least...
>>>>
>>>>
>>>>> Although, that it is much slower without asm.js could be considered a
>>>>> bug, it should still be pretty fast without it.
>>>>>
>>>>
>>>> Looks like a combination of the first rounds of compilation taking
>>>> longer to kick in, and the final compiled version still being moderately
>>>> slower... plus having to do all that on several threads simultaneously,
>>>> during the first few seconds of playback. Once it settles in it performance
>>>> seems predictable, but never as fast as either the AOT asm.js-mode
>>>> compilation or Safari's JIT compilation.
>>>>
>>>>
>>>>>
>>>>> It also appears that asm.js+threads may not be supported in release
>>>>> browsers when SAB reaches release browsers, since the hope is to get
>>>>> wasm+threads shipping in a reasonable time frame, and that would be more
>>>>> cross-browser.
>>>>>
>>>>
>>>> Ah, the wonders of working on the bleeding edge. :) I'll start looking
>>>> into a wasm build and keep multithreading on the back burner until it
>>>> arrives in wasm world...
>>>>
>>>> -- brion
>>>>
>>>>
>>>>
>>>>>
>>>>> On Sun, Mar 12, 2017 at 12:49 PM, Brion Vibber <br...@pobox.com>
>>>>> wrote:
>>>>>
>>>>>> I'm seeing great performance with USE_PTHREADS mode in Safari
>>>>>> Technical Preview, but in Firefox Nightly (and Developer Edition)
>>>>>> performance seems really spotty. My use case is video decoding, so
>>>>>> everything's got to be done within 15-35ms so frames can be drawn on 
>>>>>> time;
>>>>>> like games it's very sensitive to latency problems.
>>>>>>
>>>>>> Somewhat worryingly, I notice the error console is tossing up these
>>>>>> warnings in Firefox:
>>>>>>
>>>>>>   TypeError: asm.js type error: asm.js Atomics only enabled in wasm
>>>>>> test mode
>>>>>>
>>>>>> Everything still works though, just with a lot more latency than I
>>>>>> expect.
>>>>>>
>>>>>> The code in libvpx I'm running does have some usage of setjmp/longjmp
>>>>>> for error recovery, but if I try stubbing it out I don't see any obvious
>>>>>> changes to the performance. Threads are pre-spawned.
>>>>>>
>>>>>>
>>>>>> Sample URL using pthreads:
>>>>>> https://brionv.com/misc/ogv.js/demo-mt/#file=Knowledge_for_E
>>>>>> veryone_(short_cut).webm&player=js-mt&size=480p.vp9.webm&sou
>>>>>> rce=shortlist-vp9
>>>>>>
>>>>>> Sample URL single-threaded (using a background worker):
>>>>>> https://brionv.com/misc/ogv.js/demo-mt/#file=Knowledge_for_E
>>>>>> veryone_(short_cut).webm&player=js&size=480p.vp9.webm&source
>>>>>> =shortlist-vp9
>>>>>>
>>>>>> In Safari Technical Preview I see a significant speedup with
>>>>>> pthreads, as shown on the cyan bars on the performance reporting graph, 
>>>>>> but
>>>>>> in Firefox performance is often much worse than single-threaded and it
>>>>>> drops frames.
>>>>>>
>>>>>> Tested on 2-core and 2-core/4-thread machines. Firefox behaves
>>>>>> similarly on Mac and Windows.
>>>>>>
>>>>>>
>>>>>> Any known issues I should watch out for? Thanks!
>>>>>>
>>>>>> -- brion
>>>>>>
>>>>>> --
>>>>>> 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 emscripten-discuss+unsubscr...@googlegroups.com.
>>>>>> 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 emscripten-discuss+unsubscr...@googlegroups.com.
>>>>> 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 emscripten-discuss+unsubscr...@googlegroups.com.
>>>> 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 emscripten-discuss+unsubscr...@googlegroups.com.
>>> 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 emscripten-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to