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.