To explain further, I'm also not surprised that hand tuned assembler can get the same performance as compiled C.
To explain further, I'm also not surprised that hand tuned assembler can get the same performance as compiled C.
Well you must be smarter than I am (which is not saying much).
For my grug brain, an untyped memory-managed interpreted language will be at a significant disadvantage against a typed compiled language whatever the use case. It's a testament to the Chrome dev team's hard work.
It is also possible that the WASM VM has not benefited from as much love as the JS VM.
What remains then, is compiling to native. This is where C shines and Javascript doesn't. Because of it's data model, Javascript just can't take advantage of what you could do in plain C.
0: This rambling "explanation" is exhibit A
When people bitch about that JS is so bloated and slow, it's usually because of things interacting with the DOM and everything related to it, or just slow network connections. But then people take out their frustrations on the language instead.
Often the problem is probably that people are making too many DOM nodes (no virtualization), talking to the DOM inefficiently via a slow framework (React) and talking to the framework inefficiently (bad code).
Not sure what you mean by this. Every time I run something like document.getElementById(), it is very fast.