Happy New Year everybody!

I've encountered some weirdness in *WebAssembly* vs. *asm.js* performance 
comparison and I'm wondering if I'm doing something wrong...

1. I've compiled some simple computationally intensive code (calculation of 
Pi to 10,000 digits with Rabinowitz & Wagon spigot algorithm) as x64 with 
VS2015 Microsoft's compiler and Clang in Windows, then with Clang 4.0 & 
libcpp in Ubuntu 14.04 (Windows 10 Ubuntu subsystem) and got very close 
results: about 6.7 seconds.

2. Then I compiled this code to *asm.js* with Emscripten latest and -O3 
flag and ran it in the latest released Chrome (8.7 sec) and Nightly (7 
sec). Impressively close to the native speed!

3. Finally, I installed Emscripten incoming, which uses Clang 3.9, and 
compiled my code:
emcc t.cpp -std=c++14 -O3 -s WASM=1 -o index.html
Running the resulting *WebAssembly* code in Nightly produced the following 
console output:
trying binaryen method: native-wasml
binaryen method succeeded.
and took almost 15 seconds.
In Canary, it took almost 17 seconds.

The time was measured only for the Pi calculation:

int main(int argc, char** argv)
{
    Stopwatch<> sw;
    Pi::calculate(10000);
    sw.stop();
    std::cout << sw.elapsed()/1.0e+6 << " seconds\n";
}

So, any asm.js or wasm translation time shouldn't affect the numbers...

What is wrong here???

Thank you,
Boris

-- 
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