Hi,

Just a late observation :)

On Fri 18 Oct 2013 18:21, Stefan Israelsson Tampe <stefan.ita...@gmail.com> 
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)
            vlist-null
            (vhash-consq (string->symbol
                          (string (integer->char (+ (char->integer #\a) n))))
                          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.

Andy
-- 
http://wingolog.org/

Reply via email to