From: Marko Rauhamaa <marko@pacujo.net>
To: Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>,
"guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(
Date: Thu, 14 Aug 2014 22:24:04 +0300 [thread overview]
Message-ID: <87k36ac1t7.fsf@elektro.pacujo.net> (raw)
In-Reply-To: <87tx5fvsbs.fsf@taylan.uni.cx> (Taylan Ulrich Bayirli's message of "Thu, 14 Aug 2014 20:28:39 +0200")
Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>:
> Marko Rauhamaa <marko@pacujo.net> writes:
>
>> Yes. In my recent tests, I found (assq-ref) was twice as fast as
>> (hashq-ref) when there were 100 entries even when I made the hash
>> table quite large (1000 entries IIRC).
>
> Do you mean the averages?
I was looking for the 50th entry.
> For me, accessing the *first* entry of an alist already seems to be
> almost as slow as accessing any entry of a hash table, and accessing
> the 100th about thrice as slow.
Ok. I ran the test again, with a couple of parameter settings this time
round:
===================================================
Data Structure # Entries Look-up Duration (µs)
===================================================
hash-table 2000 0.37
alist 2000 5.88
AVL tree 2000 15.65
hash-table 100 0.35
alist 100 0.31
AVL tree 100 11.09
===================================================
The entry that was looked up was the middle element. The lookup was
performed 1,000,000 times. The AVL tree was wholly implemented in
scheme.
So the alist wasn't "twice as fast". Must have been with fewer entries.
Marko
prev parent reply other threads:[~2014-08-14 19:24 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87y4w9jog8.fsf@drakenvlieg.flower>
2014-07-05 13:40 ` cannot compile: srfi-10 define-reader-ctor 'hash '#,( Ludovic Courtès
2014-07-31 6:27 ` Jan Nieuwenhuizen
2014-07-31 19:15 ` Neil Jerram
2014-08-14 10:27 ` Taylan Ulrich Bayirli/Kammer
2014-08-14 19:42 ` Neil Jerram
2014-08-14 19:54 ` Taylan Ulrich Bayirli/Kammer
2014-08-17 15:08 ` Ludovic Courtès
2014-08-11 15:48 ` Ludovic Courtès
2014-08-13 19:59 ` Jan Nieuwenhuizen
2014-08-13 20:43 ` Marko Rauhamaa
2014-08-13 21:00 ` Jan Nieuwenhuizen
2014-08-13 21:13 ` Ludovic Courtès
2014-08-13 21:33 ` Marko Rauhamaa
2014-08-14 4:03 ` Mark H Weaver
2014-08-13 21:06 ` Ludovic Courtès
2014-08-14 9:19 ` Panicz Maciej Godek
2014-08-14 9:53 ` Marko Rauhamaa
2014-08-14 10:30 ` Panicz Maciej Godek
2014-08-14 10:36 ` Marko Rauhamaa
2014-08-14 10:45 ` Panicz Maciej Godek
2014-08-14 12:59 ` Marko Rauhamaa
2014-08-14 13:58 ` Panicz Maciej Godek
2014-08-14 11:13 ` Taylan Ulrich Bayirli/Kammer
2014-08-14 13:17 ` Marko Rauhamaa
2014-08-14 14:34 ` Taylan Ulrich Bayirli/Kammer
2014-08-14 17:16 ` Marko Rauhamaa
2014-08-14 18:28 ` Taylan Ulrich Bayirli/Kammer
2014-08-14 19:24 ` Marko Rauhamaa [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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k36ac1t7.fsf@elektro.pacujo.net \
--to=marko@pacujo.net \
--cc=guile-user@gnu.org \
--cc=ludo@gnu.org \
--cc=taylanbayirli@gmail.com \
/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.
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).