3 ms·
Yeah... the table shows that memory usage is another story entirely :)
by rjurney 17y ago
Yeah... the table shows that memory usage is another story entirely :)
- fauigerzigerk 17y agoWait a second... :-) gaius is completely right about the memory issues with Java and this is the major difference between Java and C++ nowadays. But what you see in the shootout tables is irrelevant for applications that hold a lot of data in memory. These numbers comprise almost exclusively the JVMs own memory as the benchmark problems use almost no data. If you load gigs of data into memory the 15MB or so JVM baseline memory consumption becomes negligible. My own experience is that Java uses about twice as much memory as C++ does. Where a lot of strings are used, Java's choice of UTF-16 for representing strings has a big effect on top of using references instead of values everywhere. C#'s value types can help a lot to reduce memory consumption by the way.
- igouy 17y ago> These numbers comprise almost exclusively the JVMs own memory as the benchmark problems use almost no data. 293,788KB ? 762,836KB ? 152,820KB ? 569,632KB ? 473,416KB ? 120,132 KB ?
- fauigerzigerk 17y agoYou're right, I should've been more specific about which ones I mean, but if you look at the numbers they show exactly what I was explaining. Those tests with very low memory usage show Java using 16 times as much memory as C++ because almost all of it is VM memory, whereas the tests using a lot of memory show Java using only around twice as much memory. At least that's the general picture. I know very well that it depends hugely on what kind of data structures are being used and so on, so it's going to vary.