Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!howland.reston.ans.net!ix.netcom.com!netcom.com!NewsWatcher!user
From: hbaker@netcom.com (Henry Baker)
Subject: Re: Why garbage collection?
Message-ID: <hbaker-2201961503250001@10.0.2.15>
Sender: hbaker@netcom18.netcom.com
Organization: nil organization
References: <rvillDL4v3n.I8r@netcom.com>
Date: Mon, 22 Jan 1996 23:03:25 GMT
Lines: 69

In article <rvillDL4v3n.I8r@netcom.com>, rvill@netcom.com (Richard
Villanueva) wrote:

> I understand the classical Lisp method of automatic garbage collection,
> and it is very elegant.  It reserves only one bit per cons cell (the
> mark bit).  However, on large systems, the long pause for garbage
> collection is bad, so

One of these days, I'm going to go through a number of programs which
I know do garbage collection, but which don't advertise that fact, and patch
them to print out a message "pausing for GC...".

Then, I'm going to go through the programs which _do_ advertise the fact
that they use GC, and change their messages to say "pausing for domain name
service" or "pausing to refill disk cache" or "pausing to admire the
view".

I'm also going to find a program which does reference-counting, and insert a
print statement into its count-decrementing code which says "pausing for GC...".

The lesson I'd like to teach people is that most people don't really have a clue
as to why the systems they use are slow or fast, and that if a system
advertises that it is pausing for X reason, then people will buy systems
that don't use X, or at least don't advertise the fact that they use X.

(I have a non-technical lawyer friend who does _only_ word processing, but
is constantly worried about not having enough horsepower in their Pentium
machine to handle the load, and complains that it is still slow.  I've
explained over and over again that the slowness they see has nothing to
do with the CPU power because it depends upon disk speed, memory size and
modem speed, but these facts seem to make no difference.  At least if
this person's car engine were overpowering its tires, you'd see a lot of
spinning wheels and tire-smoke...  :-)

----

The other thing I'd like to do is to ask the ACM to embargo any textbooks
that continue to prattle on about how bad GC is.  Unfortunately, these
textbooks lend credence to the old adage "If you can, do; if you can't,
write a bad textbook".

----

In the late 1970's and early 1980's, several (now) well-know people from a
certain large commercial laboratory in New Jersey decided to give numerous talks
designed to purposely mislead their audience about the costs of garbage
collection vs. its alternatives.  I can only speculate why they did this, but it
was one of the most successful big lies since Germany in the 1930's.

This mendacity has conservatively cost the U.S. software industry billions of
dollars in lost productivity, and this lie is only recently being exposed with
the development of new web languages.  Unfortunately, the wide distribution of
these people's books means that another generation of SW people has
probably already been poisoned.

Numerous tests show that replacing a reference counting system with even
a relatively simple mark-sweep GC can often improve overall memory management
performance by a factor of 2-5X.  But don't expect to read about this in
many popular programming books -- their authors are too busy parroting the
inaccuracies of others.

-- 
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html

Copyright (c) 1996 by Henry G. Baker.  All rights reserved.
** Warning: Due to its censorship, CompuServe and its subscribers **
** are expressly prohibited from storing or copying this document **
** in any form.                                                   **
