From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,19140af19dfa6e01 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-14 18:43:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc01.POSTED!not-for-mail Message-ID: <3F651919.80808@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada 0Y plans for garbage collection? References: <1127954.kcBZz6amlf@linux1.krischik.com> <3F60E747.40805@attbi.com> <1557617.vUiuI5kIPQ@linux1.krischik.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 24.34.139.183 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc01 1063590192 24.34.139.183 (Mon, 15 Sep 2003 01:43:12 GMT) NNTP-Posting-Date: Mon, 15 Sep 2003 01:43:12 GMT Organization: Comcast Online Date: Mon, 15 Sep 2003 01:43:12 GMT Xref: archiver1.google.com comp.lang.ada:42507 Date: 2003-09-15T01:43:12+00:00 List-Id: Ludovic Brenta wrote: > Linus Torvalds differs quite strongly on this: > > http://gcc.gnu.org/ml/gcc/2002-08/msg00571.html Couldn't have said it better myself. On one project I wanted to compare using garbage collection to Controlled types and managing the allocation and deallocation of objects myself. First I wrote a version that just did heap allocation, with NO garbage collection. Of course it was possible to run out of storage with this version, but I wanted to see how much overhead GC would add. As long as I had a test case that did not result in paging, this was the ultimate best case for the GC version. Then I changed the implementation to use a Controlled type, with explicit immediate frees as soon as an object was no longer used. I added less than a page of code to implement all this. Remember now the code is explicitly freeing everything. The version with the Controlled type was three times as fast as the version with no deallocation. You can imagine how motivated I was to find out how much overhead GC would add. ;-) Worse, I then changed things a bit more. Since all the nodes I was allocating were the same size, I grabbed a chunk of memory and used it as a reference counted heap where every object was the same size. (I then twiddled a bit more so objects were exactly one cache line long, and my allocater returned blocks that were cache line aligned.) Net result, this version was almost ten times as fast as the na�ve version that would quickly start paging to virtual memory if I let it. -- Robert I. Eachus "As far as I'm concerned, war always means failure." -- Jacques Chirac, President of France "As far as France is concerned, you're right." -- Rush Limbaugh