Not sure what I'm doing wrong regarding performance... starting to feel
like I am an idiot here.

1. I do *not* see it pass asm.js validation. I see two messages,

Successfully compiled asm.js code (loaded from cache in 13ms) gaia.js
TypeError: asm.js type error: void incompatible with previous return of
type signed

One is for gaia.js, another for gnuplot.js. Which is being benchmarked here?

2. I go to the run tab, and press run. It very quickly prints out GFlops.
Is that the only number I care about here? All the further work is
irrelevant to this bug report?

Then I press reset, but nothing much happens. I get more output, but no
more mentions of GFlops - what should I be comparing here?

- Alon




On Wed, Feb 12, 2014 at 4:02 PM, Alon Zakai <[email protected]> wrote:

> I don't follow? Yes, if there is no setStatus, then it will call doRun,
> and doRun will both set calledRun to true but also actually call _main, so
> main must end up being called.
>
> Which branch of emscripten are you on btw? And when did you last update?
> Perhaps we are looking at different code?
>
> - Alon
>
>
>
> On Wed, Feb 12, 2014 at 1:55 PM, Chris <[email protected]> wrote:
>
>> Hi Alon,
>>
>> Module.calledRun is set true by doRun() simply if Module.setStatus does
>> not exist... This is the code em++ appends before post.js:
>>
>>   if (Module['setStatus']) {
>>     Module['setStatus']('Running...');
>>     setTimeout(function() {
>>       setTimeout(function() {
>>         Module['setStatus']('');
>>       }, 1);
>>       if (!ABORT) doRun();
>>     }, 1);
>>   } else {
>>     doRun();
>>   }
>>
>> I compiled now with latest emscripten -O2 -g1, no asm.js error (ignore
>> the ones coming from gnuplot.js), but the performance bug after a reset
>> remains. :(
>> The new version is uploaded directly at
>> http://gaia.respawned.com
>>
>> "Reset" simply calls gaia_create() again in the worker. Is there a way to
>> open a worker console in the inspector of FF? This is a pretty handy
>> feature in chrome...
>>
>> Cheers,
>> C
>>
>> On Wednesday, February 12, 2014 8:38:49 PM UTC+1, Alon Zakai wrote:
>>
>>> Looking in src/postamble.js, calledRun is only set to true when actually
>>> running this code:
>>>
>>>     ensureInitRuntime();
>>>
>>>     preMain();
>>>
>>>     if (Module['_main'] && shouldRunNow) {
>>>       Module['callMain'](args);
>>>     }
>>>
>>>     postRun();
>>>
>>> so if you do not throw in any of those (you would see an exception), or
>>> do not define Module._main at a later time, this should work. (There is
>>> also shouldRunNow, which unless you defined INVOKE_RUN or
>>> Module['noInitialRun'], should not interfere here.) Hope that helps figure
>>> out that issue.
>>>
>>> Yes, for performance -O2 -g1 is needed.
>>>
>>> - Alon
>>>
>>>
>>>
>>> On Wed, Feb 12, 2014 at 7:22 AM, Chris <[email protected]> wrote:
>>>
>>>> Fixed, but it wasn't actually the problem. For some reason
>>>> Module.calledRun was true, so Module.run() did nothing. Setting it now
>>>> manually false before the run.
>>>> To the original problem: The -g1 version works now (index_alon.html),
>>>> without asm.js errors but is ~100 times slower. I guess this is no use in
>>>> determining why the speed loss occurred. Should I compile with -O2 and -g1 
>>>> ?
>>>>
>>>> Thanks,
>>>> Christian
>>>>
>>>>
>>>>
>>>> On Tuesday, February 11, 2014 7:32:03 PM UTC+1, Alon Zakai wrote:
>>>>
>>>>> I believe FS.unlink is what does that.
>>>>>
>>>>> - Alon
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Feb 11, 2014 at 12:55 AM, Christian H <[email protected]>wrote:
>>>>>
>>>>>> ...just noticed that chrome does complain about FS.deleteFile() not
>>>>>> found? How do I remove a file now?
>>>>>>
>>>>>> Cheers,
>>>>>> C
>>>>>>
>>>>>>
>>>>>> On Tue, Feb 11, 2014 at 9:50 AM, Christian H <[email protected]>wrote:
>>>>>>
>>>>>>> Hi Alon,
>>>>>>> I did recompile with the latest emscripten, the one I compiled with
>>>>>>> was not more than 2 months old. However, now I get nothing. I do see the
>>>>>>> asm.js warnings, but no reaction to Module.run(), also no error (even
>>>>>>> within worker triggering manually), the FS works, Module.print() works 
>>>>>>> too.
>>>>>>> That happens to all versions I compiled with -O2 or -g1. I prepared a 
>>>>>>> site
>>>>>>> loading the new (-g1) version:
>>>>>>>
>>>>>>> http://gaia.respawned.com/index_alon.html
>>>>>>>
>>>>>>> The bitcode is at
>>>>>>> http://gaia.respawned.com/GaiaE.o
>>>>>>>
>>>>>>> You don't need to wait that long, it will run until TS 1000. The
>>>>>>> performance line appears after TS 0.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Christian
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Feb 10, 2014 at 10:17 PM, Alon Zakai <[email protected]>wrote:
>>>>>>>
>>>>>>>>  Thanks. How long should this run? I waited until TS: 100 and it
>>>>>>>> still keeps going it seems.
>>>>>>>>
>>>>>>>> I see an asm.js validation error in the log, this could be related
>>>>>>>> to the performance problem. Was this compiled using latest emscripten? 
>>>>>>>> If
>>>>>>>> so, can you make a whitespace-friendly build I could take a look at? 
>>>>>>>> emcc
>>>>>>>> -g1 will do that. (Even better is if you can provide the bitcode file, 
>>>>>>>> but
>>>>>>>> not necessary.)
>>>>>>>>
>>>>>>>> - Alon
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Feb 10, 2014 at 11:13 AM, Chris <[email protected]> wrote:
>>>>>>>>
>>>>>>>>> Yes - you have to switch to the "Run"tab first. That is where the
>>>>>>>>> CFD sim task is controlled, the gnuplot tasks may/should suffer from 
>>>>>>>>> the
>>>>>>>>> same problem.
>>>>>>>>> The GFlops output comes after the first time step.
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> C
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Monday, February 10, 2014 7:21:07 PM UTC+1, Alon Zakai wrote:
>>>>>>>>>
>>>>>>>>>> Does it print out the GFlops somewhere?
>>>>>>>>>>
>>>>>>>>>> All I see is "Execution took", which went from 1.628 to 2.172
>>>>>>>>>> when I reset.
>>>>>>>>>>
>>>>>>>>>> - Alon
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, Feb 10, 2014 at 3:04 AM, Chris <[email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi all,
>>>>>>>>>>> I ported a fluid simulation C++ code (command line program) with
>>>>>>>>>>> emscripten and it works quite fantastic. I never thought JS could 
>>>>>>>>>>> run that
>>>>>>>>>>> efficiently.
>>>>>>>>>>> However, to re-run my program I wrapped the compiled version in
>>>>>>>>>>> a function (with pre/post.js) to reset its state. That usually 
>>>>>>>>>>> worked nice,
>>>>>>>>>>> but recently I get at first an awesome performance from FF (~0.3 
>>>>>>>>>>> native
>>>>>>>>>>> speed!), but after a reset it suffers a drastic performance 
>>>>>>>>>>> breakdown of a
>>>>>>>>>>> factor of 20.
>>>>>>>>>>>
>>>>>>>>>>> The site is http://gaia.respawned.com
>>>>>>>>>>>
>>>>>>>>>>> You can observe it just by clicking "Run" in the Run tab, the
>>>>>>>>>>> sparse matrix mul+add performance is measured thoroughly. At first 
>>>>>>>>>>> run:
>>>>>>>>>>> Performance (mul+add): 0.377445 GFlops
>>>>>>>>>>>
>>>>>>>>>>> After "Reset" (calling gaia_create() again in the worker):
>>>>>>>>>>> Performance (mul+add): 0.0187213 GFlops
>>>>>>>>>>>
>>>>>>>>>>> On a recent Chrome I do not get a difference, always around 0.26
>>>>>>>>>>> GFlops.
>>>>>>>>>>>
>>>>>>>>>>> Thanks for your help,
>>>>>>>>>>> Christian
>>>>>>>>>>>
>>>>>>>>>>> PS: Native gcc -O3 : 1.17 GFlops.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  --
>>>>>>>>>>> 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+unsubscribe
>>>>>>>>>>> @googlegroups.com.
>>>>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out
>>>>>>>>>>> .
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  --
>>>>>>>>> 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/groups/opt_out.
>>>>>>>>>
>>>>>>>>
>>>>>>>>  --
>>>>>>>> You received this message because you are subscribed to a topic in
>>>>>>>> the Google Groups "emscripten-discuss" group.
>>>>>>>> To unsubscribe from this topic, visit https://groups.google.com/d/
>>>>>>>> topic/emscripten-discuss/UFL7YRfvJQw/unsubscribe.
>>>>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>>>>> [email protected].
>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>  --
>>>>>> 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/groups/opt_out.
>>>>>>
>>>>>
>>>>>  --
>>>> 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/groups/opt_out.
>>>>
>>>
>>>  --
>> 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/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.

Reply via email to