3 ms·
repl.it contains code from a few years ago. That's way before a huge amount of general optimizations in emscripten, as well as asm.js. Here is a more up to date
by azakai 13y ago
repl.it contains code from a few years ago. That's way before a huge amount of general optimizations in emscripten, as well as asm.js. Here is a more up to date Lua VM running in JS:
http://kripken.github.io/lua.vm.js/repl.html http://kripken.github.io/lua.vm.js/repl.html
But even that is already out of date ;) just this week I found that I was building Lua with a bad choice of optimization flags. We include Lua VM benchmarks in the emscripten test suite, so for the latest numbers (with the proper optimization flags), see
https://docs.google.com/spreadsheet/ccc?key=0AkuGewEm05tZdFdKQlEtaFBmX3NjTWlHOVlDbXloY1E&usp=sharing#gid=2 https://docs.google.com/spreadsheet/ccc?key=0AkuGewEm05tZdFd...
It's possible to run the Lua VM in JS at only about 50% slower than a native build.
edit: fix link
- binji 13y agoAh, thanks for that! I was wondering if repl.it was out of date. Might be worthwhile to get the owner to update... :)
- azakai 13y agoRegarding repl.it, I'm not sure how active it is. Their python C port for example is 2 years since the last update. I'll ping them to see. Regarding lua, I updated the lua vm project, and tried your fibonacci function from before in the repl http://kripken.github.io/lua.vm.js/repl.html http://kripken.github.io/lua.vm.js/repl.html Looks like in both firefox and chrome it runs in about a second in JS, which feels about the same as the time it takes in PNaCl in chrome on http://gonativeclient.appspot.com/demo/lua http://gonativeclient.appspot.com/demo/lua