home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!news.mentorg.com!bcannard
- From: bcannard@hppcb36.mentorg.com (Bob Cannard @ PCB x5565)
- Subject: Re: Garbage Collection for C++
- Originator: bcannard@hppcb36
- Sender: news@news.mentorg.com (News User)
- Message-ID: <1992Aug15.025613.4571@news.mentorg.com>
- Date: Sat, 15 Aug 1992 02:56:13 GMT
- References: <1992Aug6.014619.2111@ucc.su.OZ.AU> <DAVEG.92Aug13025629@synaptx.synaptics.com> <TMB.92Aug14130323@arolla.idiap.ch>
- Nntp-Posting-Host: 134.86.73.85
- Organization: Mentor Graphics
- Keywords:
- Followup-To:
- Lines: 49
-
-
- In article <TMB.92Aug14130323@arolla.idiap.ch>, tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
- |> In article <1992Aug14.021547.15215@news.mentorg.com> bcannard@hppcb36.mentorg.com (Bob Cannard @ PCB x5565) writes:
- |>
- |> In article <DAVEG.92Aug13025629@synaptx.synaptics.com>, daveg@synaptics.com (Dave Gillespie) writes:
- |> |> Couldn't we get away with having a garbage collector that didn't
- |> |> need pointers to be declared `GC'?
- |>
- |> I can't see that this is viable given the basic constraints on C++: among
- |> other things, those who don't want GC shouldn't have to suffer the hits.
- |>
- |> What "hits"? In all the cases that I have looked at, the GC overhead
- |> has been _smaller_ than the overhead of explicit memory management in
- |> C++. Now, maybe my sample of programs is biased, but if you claim that
- |> there are "hits", please state either whether you have concrete
- |> evidence that there are, or whether your statement is just religious
- |> belief. Your vague statements might easily turn into gospel truth.
- |>
- |> Based on my experience, I would turn your statement around and say:
- |> "those of us who want GC shouldn't have to suffer the inefficiencies
- |> of not having it".
- |>
- |> Thomas.
-
- It's practical experience. A question for you: have you ever used a
- custom-made, tailored new/delete (or malloc/free), instead of the ones provided
- as standard? I have. I've been inside malloc (it's not a pretty sight :-) ),
- worked around it, optimised it, jiggled the numbers, bypassed it, and generally
- done everything I could to optimise storage recycling. The difference in
- performance (on the right type of application) is startling, and more than the
- difference between manual and automatic. I'm willing to talk at greater length
- about storage allocation, if people are interested, but I'd rather do it in a
- different thread, or off-line.
-
- In a *fair* comparison between an optimised GC and an optimised
- manual scheme, the manual scheme will win if the decision of when and what to
- delete can be made at compile time. In a situation where the decision can only
- be made at run time, the GC will win. This is one reason why I want both
- mechanisms.
-
- There are plenty of reasons whey GC is genuinely more efficient than
- manual: it allows better-designed data structures, it eliminates the need to
- copy data which plagues large systems using manual recycling, and it reduces
- development and maintenance costs. But the idea that GC is inherently faster
- than manual is bogus.
- --
- bob_cannard@mentorg.com "Human beings? ... Well, I suppose they are a
- form of life, even if they are unspeakable"
- Exprssed opinions are not necessarily those of Mentor Graphics Corporation.
-