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

I'm curious about the performance tradeoffs of Javascript versus native code?

A few weeks ago, I tried writing something that was long-running, CPU intense, ect, in a webworker. It was so darn slow that I switched to a native language. (I hope I didn't do something silly that made my code run more slowly than it should.)

I see some mention about running in WASM. Does this do something like have ordinary Tesseract compiled for WebAssembly and then fallback to Javascript?



A while back I ported several c++ libraries with emscripten and it's usually just 2-10x slower than native. It gets maybe another order of magnitude worse if you're a porting a library that heavily relies on vectorization which isn't available on the web.




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

Search: