Hi,<div><br></div><div>The extra cost could be brought by sandboxing (protected jmp) and different computing architect. In my macbook air the native</div><div>interpreter runs (pi 10000) for 182ms with a 64bit compilation while it take 403ms in nativeclient with a 32bit compilation(native client run 32 bit code on an osx)<br>
</div><div><br></div><div>Currently there's no directly way to interact with DOM, though nacl module could interact with javascript with PostMessage / HandleMessage primitives thus affect the DOM.</div><div><br></div>
<div>Thanks</div><div>Meng</div><br><div>On Tue Feb 04 2014 at 9:28:01 PM, Marc Feeley <<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Feb 3, 2014, at 6:46 AM, Zhang Meng <<a href="mailto:wsxiaoys.lh@gmail.com" target="_blank">wsxiaoys.lh@gmail.com</a>> wrote:<br>
<br>
> Hi, Marc<br>
><br>
> It has been quite a long time since the last discussion in Silicon Valley and I finally got some spare time to complete it during the Lunar new year Holiday.<br>
><br>
> <a href="http://mzh.im/gambit-in-nacl/" target="_blank">http://mzh.im/gambit-in-nacl/</a><br>
><br>
> * HTML5 local storage is mount at /mnt/html5<br>
> * <a href="http://mzh.im/gambit-in-nacl/scm/" target="_blank">http://mzh.im/gambit-in-nacl/<u></u>scm/</a> is mounted at /mnt/http, the pi example is loaded with it.<br>
><br>
> Enjoy!<br>
> Meng<br>
<br>
Happy new year to you!<br>
<br>
The Gambit NACL port is very cool!<br>
<br>
I did a very quick performance testing using (pi 10000) and, on Chrome, gambit-in-nacl is about 36 times faster than gambit-in-the-browser (<a href="http://feeley.github.io/gambit-in-the-browser" target="_blank">http://feeley.github.io/<u></u>gambit-in-the-browser</a>) which is compiled with emscripten.  On the other hand, the native Gambit interpreter on my machine runs (pi 10000) about 4 times faster than gambit-in-nacl.<br>

<br>
Note that these are not definitive figures because these 3 instances of Gambit were not compiled with the same configure options, C compiler, C optimization levels and word width.  I know that gambit-in-nacl was compiled with -O2, and gambit-in-the-browser could not be compiled to use single-host mode and indirect branches (because of an issue with emscripten).<br>

<br>
Do you have an idea why compiling with NACL gives a 4x slowdown compared to native compilation?<br>
<br>
Also, is there a way for Scheme code to interact with the DOM?<br>
<br>
Marc<br>
<br>
</blockquote>