3 ms·
Of course there is cold start. Both Node and Deno use JIT compilation just like regular Java, which means they warm up. JS code will use more RAM than Java for
by fidgewidge 4y ago
Of course there is cold start. Both Node and Deno use JIT compilation just like regular Java, which means they warm up. JS code will use more RAM than Java for equivalent constructs, not less. You may be fooled though, by the way that the JVM by default will use free RAM rather than burn energy/CPU collecting garbage when it doesn't need to. So it will look like your app is using a lot of RAM but in reality the JVM will give it up when asked.
- SillyUsername 4y agoMy experience of paying for cloud services does not back that up. Java AWS Lambdas are typically 2-3x heavier in memory usage than a TS/JS equivalent, and the benefit of that warmup is negated if the Lambda shuts down due to idle time. "Give it up when asked" !== less streamlined, it means expanding heap is required for normal operation. Too little heap, it buckles, GC is almost constant, and performance goes out of the window.
- fidgewidge 4y agoThat's inherent to any GC algorithm. More CPU time = less RAM usage because garbage is collected more aggressively. I don't understand why you think that JS, a JIT compiled GC'd language, doesn't warm up and doesn't have to trade off GC time vs memory.