[1563] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: binary tree/other..

daemon@ATHENA.MIT.EDU (Sat Mar 11 22:35:33 2000 )

Date: Sat, 11 Mar 2000 20:15:33 -0700
From: Brandon Gillespie <brandon@roguetrader.com>
To: coldstuff@cold.org
In-Reply-To: <>; from roacho@xamocorp.com on Sat, Mar 11, 2000 at 05:47:15PM -0600
Reply-To: coldstuff@cold.org

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

On Sat, Mar 11, 2000 at 05:47:15PM -0600, roacho@xamocorp.com wrote:
> I need to write some code which will be used in 3 places whenever a reque=
> is made to my server. It is to keep track of unique ips. I will likely
> write it a few different methods and test for speed/memory usage, however=
> would appreciate any suggestions that peopel have.
> I am currently considdering taking the ip and turning it into a single
> integer and using objects in the database as nodes in a binary tree.  I'm
> not sure how much overhead will come with the use of all those objects.
> I'm also think of using nested dictionaries and a list to store the ip's =
> hierarchical numbering based on the four number fields. I know dictionari=
> tend to be slow, and ColdC's non-mutable datatypes can be a pain, but I
> dont know what is the lesser of the two evils.
> Anywho, I'm off to write some code.. if someone can suggest something
> better please do.

Dictionaries are not 'slow'.  They do have a large cost during
creation (adding elements) but they are quite fast for retrieval (they
are basically just data hashes).

As for new suggestions, dunno.  I just wanted to clarify :)


Content-Type: application/pgp-signature

Version: PGPfreeware 5.0i for non-commercial use
MessageID: mBMel9NeuR5xppKQUp7dwBX/NX/KAfgS