3 ms·
Java is actually incredibly well written for large scale multicore systems. Java's garbage collector, although the source of many performance headaches, is in
by dragontamer 5y ago
Java is actually incredibly well written for large scale multicore systems.
Java's garbage collector, although the source of many performance headaches, is in fact very sophisticated and "does the right thing" for most OOP-style code. Yes, it takes some understanding and tuning (and yes, there are multiple garbage collectors you're supposed to test out as you tune your software...) but that's the sort of thing that's available.
In C/C++ world: you can't just swap out versions of "malloc" or "new" as easily (ie: without recompiling everything, to tune / test your code on different systems). Restarting your JVM with slightly different garbage collector settings over-and-over again is absolutely a thing in the Java world to help tune your applications to the machines they run on.
---------
Java's high performance concurrency libraries are very well written as well. And there are some real speed demons (Azul) out there.
Its really a different world and model than the C/C++ world.
- nightpool 5y agoThere are actually plenty of runtime tuning parameters for malloc and friends (using environment variables), and you can swap out allocators using LD_PRELOAD without recompiling anything.
- viraptor 5y agoYou can do the same in C - for example: LD_PRELOAD=libjemalloc.so MALLOC_CONF=narenas:1 /your/unmodified/app