[Ohrrpgce] SVN: teeemcee/8529 node_hsint.js: implement more functions (inc a couple that weren't in ha

Ralph Versteegen teeemcee at gmail.com
Sun Mar 12 23:25:07 PDT 2017


On 13 March 2017 at 09:17, <subversion at hamsterrepublic.com> wrote:

> teeemcee
> 2017-03-12 13:17:11 -0700 (Sun, 12 Mar 2017)
> 480
> node_hsint.js: implement more functions (inc a couple that weren't in
> hamsterspeak.hsd; bugfix
>
> Can now run benchmark.hss if you comment those benchmarks that obviously
> isn't in hamsterspeak.hsd (plus a showstringat call).
>
> Surprisingly, while performance on math ops is 20x faster than the OHR,
> performance on readglobal/writeglobal/runscriptbyid is 20x slower.
> Something is wrong; console.time()/console.endTime() shows far lower
> running times for calling some scripts directly.
>

I made a mistake when using console.time()/console.endTime().

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.

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.


> ---
> U   wip/hamsterspeak.hsd
> U   wip/node_hsint.js
> U   wip/testgame/benchmark.hss
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20170313/efd3a47c/attachment.htm>


More information about the Ohrrpgce mailing list