Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Cool. I recently wrote a low-level sha1 implementation in pure javascript, trying to leverage asm.js (http://github.com/srijs/rusha).

Can you tell me, how did you confirm you wrote valid asm.js and there was no fallback-mechanism kicking in?

I benchmarked my implementation, of course, and noticed a 2x speedup. However, this seems quite less for the this type of low-level algorithm...



Open the error console (via the Web Developer menu item) and you'll see messages there. Success shows up as "Error: successfully compiled asm.js code." :-)

P.S. Looking at your code, I can tell it's not asm.js conformant yet, though it should just be a bunch of small tweaks (e.g. an expression like (a+b) will need to be (a+b)|0, etc.).


Thank you. I just updated my code and it's really within half of native speed now... (benchmarks in the README, if any of you are interested)

asm.js is very exciting technology!


You're welcome!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: