unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Which Elisp data structure is fastest for searching?
@ 2024-12-25  9:33 Jean Louis
  2024-12-26  6:24 ` Joel Reicher
  0 siblings, 1 reply; 8+ messages in thread
From: Jean Louis @ 2024-12-25  9:33 UTC (permalink / raw)
  To: Help GNU Emacs

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-12-28  3:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-25  9:33 Which Elisp data structure is fastest for searching? Jean Louis
2024-12-26  6:24 ` Joel Reicher
2024-12-26  8:53   ` Jean Louis
2024-12-26  9:23     ` tomas
2024-12-26 11:49       ` Jean Louis
2024-12-26 23:03     ` Joel Reicher
2024-12-27 11:16       ` Jean Louis
2024-12-28  3:32         ` Joel Reicher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).