[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vhash speed thread safeness

From: Andy Wingo
Subject: Re: vhash speed thread safeness
Date: Mon, 24 Mar 2014 21:59:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)


Just a late observation :)

On Fri 18 Oct 2013 18:21, Stefan Israelsson Tampe <address@hidden> writes:

> I did some tests witha C-based vhash implementation, it's possible to 
> increse the speed by 30x compared to current vlist imlpementation in
> guile.

If you are using stable-2.0 you are using a bad hash function.  Master
has a much better one, though we should still replace it with Siphash or
something soon.  Anyway it can be quite a problem for vhashes.

Incidentally, this test case:

    (use-modules (ice-9 vlist))
    (define vl
      (let lp ((n 0))
        (if (= n 26)
            (vhash-consq (string->symbol
                          (string (integer->char (+ (char->integer #\a) n))))
                         (lp (1+ n))))))
    (let lp ((n 0)) (when (< n #e1e6) (vhash-assq 'j vl) (lp (1+ n))))

takes 1.5s in stable-2.0 and 0.17s in master.  The hash function isn't
the only difference of course.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]