3 ms·
The main problem with JS being sluggish (in electron apps for example) is memory and especially the GC. I can optimize CPU usage all I want, but only after I o
by cel1ne 9y ago
The main problem with JS being sluggish (in electron apps for example) is memory and especially the GC.
I can optimize CPU usage all I want, but only after I optimized for minimum allocations, the tiny, but noticeable lags now and then would disappear.
The average javascript-GC must be really simple/naive compared to seasoned workhorses like the JVM's various GCs.
There I can happily create millions of short-lived objects before getting problems in a single-user application.
- chillacy 9y agoWell, you can run JS on the JVM through Oracle's Rhino (now Nashorn), but apparently perf is still largely worse than Sunspider or V8. The language doesn't lend itself to optimization as much as java does for JVM bytecode: https://blogs.oracle.com/nashorn/nashorn-architecture-and-performance-improvements-in-the-upcoming-jdk-8u40-release https://blogs.oracle.com/nashorn/nashorn-architecture-and-pe...
- unkown-unknowns 9y agoProbably part of the problem is also the fact that JavaScript is a very dynamic language. I think even the JVM team would struggle to improve on the state of the art in js vm tech. Their experience in making JVM might not be all that useful in the context of js.