chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Does Chicken garbage collect unreferenced symbols?


From: John Cowan
Subject: Re: [Chicken-users] Does Chicken garbage collect unreferenced symbols?
Date: Mon, 24 Aug 2009 02:47:49 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

Andrew Reilly scripsit:

> If you're going to have a *lot* of these strings (and you are,
> or you wouldn't be worried about the GC angle), then you could
> be better off with a "real" hash table or r/b-tree or similar
> structure.  Even with the assoc -> assq conversion your search
> is still O(N), when it could be O(logN) or O(1).

I expect each a-list to be reasonably short (10-20 items), so constant
factors dominate the search, but there may be a *lot* of a-lists.
A-lists also have the advantage that you can push new "frames" on them
and pop them later in constant time, which is not the case for hashtables
or trees.

I'm also not a big fan of libraries with memory leaks: they don't work
well in programs that run for a long time, like servers.

-- 
John Cowan    address@hidden    http://ccil.org/~cowan
Objective consideration of contemporary phenomena compel the conclusion
that optimum or inadequate performance in the trend of competitive
activities exhibits no tendency to be commensurate with innate capacity,
but that a considerable element of the unpredictable must invariably be
taken into account. --Ecclesiastes 9:11, Orwell/Brown version




reply via email to

[Prev in Thread] Current Thread [Next in Thread]