So your Blob.cpp is llvm bitcode, not sure if that's what you wanted, but in anycase, I believe you're seeing somewhat expected behavior from Chrome. Basically, the JIT is coming into play, Firefox uses asm.js specific AOT, so it'll give best runtime perf at possibly some startup cost. As far as Chrome, the turbofan optimizer just kind of takes asm.js as a hint about the type of optimizations it can do, but the first time you run that function, it's running interpreted. I bumped up the program memory size, and ran the blobify method 10 times, this was the resulting times:
Blobifying took 85ms Ashara.js:211 Blobifying took 56ms Ashara.js:211 Blobifying took 26ms Ashara.js:211 Blobifying took 18ms Ashara.js:211 Blobifying took 12ms 2Ashara.js:211 Blobifying took 8ms Ashara.js:211 Blobifying took 9ms Ashara.js:211 Blobifying took 8ms Ashara.js:211 Blobifying took 7ms On Thursday, April 7, 2016 at 5:17:20 PM UTC-7, Gareth Morgan wrote: > > Code here: > https://www.dropbox.com/s/ft2dzlpkjfbav32/html.zip?dl=0 > > Ashara.js is the calling JS file, Blob.js is the generated file. > > I actually verified this only happens on Chrome, Firefox seems better > (8ms). > > > > On Thursday, April 7, 2016 at 5:12:00 PM UTC-7, Charles Vaughn wrote: >> >> Can you share code, or at least the output JS? there's a lot of factors >> that will cause Emscripten built JS to perform poorly. >> >> On Thursday, April 7, 2016 at 4:41:13 PM UTC-7, Gareth Morgan wrote: >>> >>> I am experimenting with using Emscripten generated code in my Javascript >>> application. The results are pretty disappointing performance-wize. I am >>> seeing 40x slower on Chrome 49.0.2623.110 (compiling with emcc -o3) >>> versus a release build on visual studio. >>> >>> I have a fairly straight forward marching squares based geometry >>> generation function, running in a plain EXE complied with visual studio in >>> release mode, the function call takes around 2.5ms (as reported by >>> QueryPerformanceCounter), the identical function run in my javascript >>> appliction takes 90-100ms (measured by Date().getMilliseconds()). I have >>> verified the time scales roughly with the size of the problem, so it's not >>> just setup/JIT cost. >>> >>> My compile line is this; >>> emcc DCEL.cpp MS.cpp Blob.cpp -o html/Blob.js -O3 -s >>> EXPORTED_FUNCTIONS="['_Blobify','_Init']" >>> >>> >>> I realize there is no native code support on this version of Chrome, but >>> is this expected? Am I missing an optimization step? >>> >> -- 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.
