Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion reducing number consing
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joe Marshall  
View profile  
 More options Dec 17 2003, 7:49 pm
Newsgroups: comp.lang.lisp
From: Joe Marshall <prunesqual...@comcast.net>
Date: Thu, 18 Dec 2003 00:49:30 GMT
Local: Wed, Dec 17 2003 7:49 pm
Subject: Re: reducing number consing

Raymond Toy <t...@rtp.ericsson.se> writes:
> Shouldn't you profile it with real stuff instaed of test code before
> micro-optimizing this?

> Luke Gorrie was saying that in one of his ethernet switch (?)
> programs, he was consing for every single ethernet packet.  It turned
> out that it didn't really matter, and generational GC took care of the
> consing quite well.

With a good generational GC (and the appropriate tuning), you can cons
garbage at a phenomenal rate for practically nothing.  One program
that I have chews through several gigabytes in a few seconds with very
little GC overhead.  Basically, the generational GC kicks in, notices
that absolutely nothing points at the latest generation, and just
resets the consing frontier to the beginning.

This isn't to say that you can *always* get away with this, nor that
it is *never* worthwhile to handle memory management manually, but in
my experience it is almost never worthwhile worrying about consing
stuff that will be immediately thrown away.

Incidentally, if you are consing stuff that you are *not* throwing
away, then you will want to be concerned about the GC.  A generational
GC will end up promoting the structures through the various
generations unnecessarily.

--
~jrm


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google