help-gnu-emacs
[Top][All Lists]
Advanced

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

Which Elisp data structure is fastest for searching?


From: Jean Louis
Subject: Which Elisp data structure is fastest for searching?
Date: Wed, 25 Dec 2024 12:33:08 +0300

It says in Emacs Lisp manual:

* Hash Tables::             Very fast lookup-tables.

(info "(elisp) Hash Tables")

8 Hash Tables
*************

A hash table is a very fast kind of lookup table, somewhat like an alist
(*note Association Lists::) in that it maps keys to corresponding
values.

The above is not so conclusive and I have not done measurements.

It says "somewhat like an alist", but is the alist faster in searching
through elements or the hash table?

I wish to make website search, something I always had before on
websites, though at the time I was using Perl and shell tools. Now I
am using Emacs Lisp for website applications.

Each piece of information in the data structure such as plist, alist,
hash, will have:

- title
- URL
- description
- summary plain text which is shorter than the actual text

I will search all of the pieces of information.

With alist that may be easier. With hash, I would need to structure
the `value' part again into four different things, not so?

What would be better decision?


Jean Louis



reply via email to

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