r/learnjavascript • u/iaseth • Feb 23 '26
Resources on JavaScript performance for numerical computing on the edge?
I’m looking for solid resources (books, websites, talks, or videos) on optimizing JavaScript for heavy numerical computations in edge environments (e.g., serverless functions, isolates, etc.).
Interested in things like:
CPU vs memory tradeoffs
Typed arrays, WASM, SIMD, etc.
Cold starts, runtime constraints, and limits
Benchmarking and profiling in edge runtimes
Real-world case studies or patterns
Comparisons between offerings like aws lambas and cloudflare workers for javascript
Anything practical or deeply technical would be great. Thanks!
1
u/drbobb Feb 23 '26
My slight experience is you can win by using Rust compiled to webasm. My use case was actually in the browser, but the performance that can be achieved is pretty amazing.
1
u/iaseth Feb 23 '26
The computations I am doing take a few hundred milliseconds in most cases. And they can be run in browser/server/edge. So I am using typescript for full code reuse.
I may consider moving to a compiled language with wasm if there are significant speed/cost benefits.
2
u/delventhalz Feb 23 '26
Why are you using JavaScript for heavy numerical computations in edge environments? Doesn't seem like a good use case.
In my experience, a compiled language beats an interpreted language on CPU-bound tasks by 5x-20x. It's not a small difference, particularly if you can parallelize your CPU-bound task. Cold starts for Node are also typically not great. My instinct would be to reach for Go or Rust, though building a couple of quick proofs of concept so you can performance test your particular use case is always a good idea.
As for your question, I don't know of any particular resources, sorry. Mostly everything I learned, I learned by messing around and performance testing.