<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 13 March 2017 at 09:17,  <span dir="ltr"><<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">teeemcee<br>
2017-03-12 13:17:11 -0700 (Sun, 12 Mar 2017)<br>
480<br>
node_hsint.js: implement more functions (inc a couple that weren't in hamsterspeak.hsd; bugfix<br>
<br>
Can now run benchmark.hss if you comment those benchmarks that obviously<br>
isn't in hamsterspeak.hsd (plus a showstringat call).<br>
<br>
Surprisingly, while performance on math ops is 20x faster than the OHR,<br>
performance on readglobal/writeglobal/<wbr>runscriptbyid is 20x slower.<br>
Something is wrong; console.time()/console.<wbr>endTime() shows far lower<br>
running times for calling some scripts directly.<br></blockquote><div><br></div><div>I made a mistake when using console.time()/console.<wbr>endTime().<br><br></div><div>My conclusion is that script calls in hspeakrt are slow because it uses yield* (the equivalent of "yield form" in Python) to call scripts (and also "yield" to call a builtin command). This is done to allow suspending a script due to a wait command or other reason, and seems pretty much unavoidable while allowing asynchronous commands. Command calls could be sped up, though.<br><br></div><div>This is a limitation of javascript, which has generator semantics copied from Python, instead of including the more general abstraction of coroutines which would have no performance cost.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
U   wip/hamsterspeak.hsd<br>
U   wip/node_hsint.js<br>
U   wip/testgame/benchmark.hss<br>
______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org">ohrrpgce@lists.motherhamster.<wbr>org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.<wbr>org/listinfo.cgi/ohrrpgce-<wbr>motherhamster.org</a><br>
</blockquote></div><br></div></div>