Google Groups Home
Help | Sign in
Message from discussion Beginner question
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
Pascal Bourguignon  
View profile
 More options Jan 31 2005, 3:12 pm
Newsgroups: comp.lang.lisp
From: Pascal Bourguignon <s...@mouse-potato.com>
Date: 31 Jan 2005 21:12:47 +0100
Local: Mon, Jan 31 2005 3:12 pm
Subject: Re: Beginner question

yoel.jacob...@gmail.com writes:
> Drew,

> Thanks. I'm actually reading this book and do find it readable and
> practical. Yet, I can't read such a book from cover to cover without
> any practice. I find that  simple daily tasks to be a good practice.

> I just wonder regarding your recommendation against plist for storing
> my strucutre. Practical Lisp clearly recommends Hash Tables for large
> tables and plists/alists for small tables for efficiency reasons.

> May you please elaborate?

It's all in the constants.

Access time to sequential structures like p-lists or a-lists is O(N),
with N=number of entries, while for hash-table, it's anything between
O(1) and  O(log(N)), which is much better.  But really, it's only
better when N -> +infinity, because for hash-table you must spend a
lot of time computing the hash value for the key (with SXHASH), it's
usually slower than comparing a few keys in the lists, and "few" can
be as high as 50, depending on the test function (EQL hash is faster
than EQUALP hash).

--
__Pascal Bourguignon__                     http://www.informatimago.com/

Nobody can fix the economy.  Nobody can be trusted with their finger
on the button.  Nobody's perfect.  VOTE FOR NOBODY.


    Reply to author    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
©2008 Google