all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dai Yuwen <daiyuwen@sdf.lonestar.org>
Cc: emacs-devel@gnu.org
Subject: Re: performance of converting alist to hash table
Date: Wed, 19 May 2004 12:02:02 +0000	[thread overview]
Message-ID: <20040519120202.GB2149@SDF.LONESTAR.ORG> (raw)
In-Reply-To: <x51xlhore5.fsf@lola.goethe.zz>

On Tue, May 18, 2004 at 02:23:46PM +0200, David Kastrup wrote:
> Dai Yuwen <daiyuwen@sdf.lonestar.org> writes:
> 
> > Dear all,
> > 
> > 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))))
> > 
> > And how I call the function:
> > 
> > (convert-alist-to-hash ta 
> > '(("w1" "aaaa")
> > ("w2" "aa")
> > ("w3" "aak")
> > ...))
> 
> Did you byte-compile the function?
No matter whether I compiled the function or not, the result almost the same.

> 
-- 
daiyuwen@freeshell.org
SDF Public Access UNIX System - http://sdf.lonestar.org

      reply	other threads:[~2004-05-19 12:02 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
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 [this message]

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=20040519120202.GB2149@SDF.LONESTAR.ORG \
    --to=daiyuwen@sdf.lonestar.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.