[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(
From: |
Marko Rauhamaa |
Subject: |
Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,( |
Date: |
Thu, 14 Aug 2014 22:24:04 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
Taylan Ulrich Bayirli/Kammer <address@hidden>:
> Marko Rauhamaa <address@hidden> 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
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, (continued)
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Panicz Maciej Godek, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Marko Rauhamaa, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Panicz Maciej Godek, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Marko Rauhamaa, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Panicz Maciej Godek, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Taylan Ulrich Bayirli/Kammer, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Marko Rauhamaa, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Taylan Ulrich Bayirli/Kammer, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Marko Rauhamaa, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Taylan Ulrich Bayirli/Kammer, 2014/08/14
- Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(,
Marko Rauhamaa <=
Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Taylan Ulrich Bayirli/Kammer, 2014/08/14
Re: cannot compile: srfi-10 define-reader-ctor 'hash '#,(, Ludovic Courtès, 2014/08/18