2 ms·
Of course you're right in cases of a cold start. But if I understand the benchmark in the linked post correctly, the TTFB was measured assuming that the VM was
by tylerhou 5y ago
Of course you're right in cases of a cold start. But if I understand the benchmark in the linked post correctly, the TTFB was measured assuming that the VM was already hot & and the code optimized through TurboFan already. (Hence "assuming the function is hot.")
Also, I don't see Rust + WASM on the linked benchmarks. WASM code still has to run in a VM and probably uses the Node.js runtime for syscalls. (Based on a quick search, it seems like most people compile to WASM and create Node bindings with wasm-bindgen.)
Third, my claim isn't that JS can reach Rust+WASM speeds; just that it's not as slow as you might expect because you do have type information.
Anyway, the whole point is moot because we're arguing over microsecond differences.
- d110af5ccf 5y agoIn many cases those TechEmpower benchmarks show JavaScript beating both C++ and Rust frameworks. Are those tests anywhere close to being representative of real world use? V8 really is an incredible piece of engineering, but then so is LLVM. For context I don't do much if any web stuff.
- josephg 5y agoI think whats going on is that the code involved really isn't spending much time in JS / C++ / whatever at all. The winners are probably libraries tuned to make good use of threading, io_uring and stuff like that.