MOO-cows Mailing List Archive

[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: my kingdom for a hash table!



Amy Bruckman wrote:
> 
> In MOOSE, I'm using hash tables for verb lookup for in-db parsing.
> I implemented this by having each hash slot be a property on the object.

If you don't like that, keep in mind that:

	object.(propname)

is almost exactly the same as:

	values[propname in keys]

I would have to do some experiments to determine which one is faster,
but in most situations I would expect them to be very nearly equal.
Both are linear searches, of course, but take advantage of the fact that
it's a linear search in C code rather than any other kind of search in
MOO code.

> hash tables incorporated into the server.  It's really key to making
> cool things with in-db parsing possible.

s/possible/fast, maybe.

--Ben

Follow-Ups: References:
Home | Subject Index | Thread Index