2 ms·
The JVM has its own garbage collector. Every language uses it. There may be tiny differences in the way code generators and optimizers work, which mean they ma
by jfengel 6y ago
The JVM has its own garbage collector. Every language uses it.
There may be tiny differences in the way code generators and optimizers work, which mean they may not get exactly the same properties out of equivalent code. For example, if they're generating a lot of objects behind the scenes, the GC improvements might help more, or less, or even do worse.
But that's the kind of thing that's really dependent on the algorithm you've implemented. So mostly likely you get some benefit for free. If you don't, you'll need to benchmark to find out. The optimizers do a lot of work for you (and the JVM does a ton of language-independent optimization), but some things are up to experiment.