all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: performance of converting alist to hash table
Date: 16 May 2004 13:18:07 +0200	[thread overview]
Message-ID: <uy8nsy61c.fsf@gnu.org> (raw)
In-Reply-To: <20040516095522.GA1625@SDF.LONESTAR.ORG> (message from Dai Yuwen on Sun, 16 May 2004 09:55:22 +0000)

> Date: Sun, 16 May 2004 09:55:22 +0000
> From: Dai Yuwen <daiyuwen@sdf.lonestar.org>
> 
> I'm trying to convert a large alist(nearly 7000 elements in it) to a
> hash table. But I found the performence of my function is poor: on a
> Celeron 333MHz, 196M memory system, it'll take 15 seconds to finish
> converting. 
> 
> This is the function:
> 
> (defun convert-alist-to-hash (table  w)
>   (let ((l w))
>      (while l
>        (setq char (car (car l))
>              key (car (cdr (car l)))
>              l (cdr l))
>        (puthash char key table))))

Did you try `mapcar' and its variants?

  parent reply	other threads:[~2004-05-16 11:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-16  9:55 performance of converting alist to hash table Dai Yuwen
2004-05-16 10:13 ` Thien-Thi Nguyen
2004-05-16 12:35   ` Dai Yuwen
2004-05-16 11:18 ` Eli Zaretskii [this message]
2004-05-16 12:14   ` Dai Yuwen
2004-05-16 14:02     ` Andreas Schwab
2004-05-16 15:51       ` Adrian Aichner
2004-05-17  1:18       ` Dai Yuwen
2004-05-17 17:43 ` Ted Zlatanov
2004-05-17 23:37   ` Miles Bader
2004-05-18 11:50     ` Dai Yuwen
2004-05-18 13:42       ` Stefan Monnier
2004-05-19 11:59         ` Dai Yuwen
2004-05-19 23:27           ` Kenichi Handa
2004-05-26 13:29             ` Dai Yuwen
2004-05-26 23:21               ` Kenichi Handa
2004-05-18 12:23 ` David Kastrup
2004-05-19 12:02   ` Dai Yuwen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uy8nsy61c.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.