Why does Scala consume 2-3x more RAM than competitors in the Computer Language Benchmarks Game?
Is it relat开发者_如何学Pythoned to garbage collection? It just seems odd that it performs so well in all other areas and fails miserably on memory consumption.
Link: http://benchmarksgame.alioth.debian.org/u32/scala.html
Without addressing each case, in general, Scala is happy to create many objects, both small and large, to make your life easier. If you specifically program to have a small memory footprint, then Scala can be only slightly less compact than Java. Otherwise, if you're trying to make the program fast and easy to code (but you don't specifically pay attention to memory), it'll tend to be larger.
If anyone wanted to create small-memory-footprint versions of the programs and submit them, I'm sure they'd be accepted.
精彩评论