Re: C++ Speed Vs. Java
stork wrote:
Stork replied to:
And without garbage collection, you still have added overhead
(especially in a multithreaded environment) to ensure that the
object eventually gets deleted. It's not accidental that people
trying to show off the performance advantages of garbage
collection tend to use multithreaded programs with lots of
strings and substrings:-).
Wait a second though. Multithreading is the ultimate downfall of
garbage collection, because most garbage collectors have to ultimately
be locked from time to time. In C++, at least, you can set up your
own thread local memory managers, so that, most of your allocations
within a thread won't bump into allocations on another thread,
affording genuinely maximum performance. You simply can't do that in
a high level language like Java or C#.
Do you have any concrete measurements to back up that
assertion? The first thing you do when you want to write a
benchmark showing garbage collection in a favorable light is
make the benchmark multithreaded.
--
James Kanze (Gabi Software) email: james.kanze@gmail.com
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]