unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: vhash speed thread safeness
Date: Mon, 24 Mar 2014 21:59:28 +0100	[thread overview]
Message-ID: <87lhvzuxcf.fsf@pobox.com> (raw)
In-Reply-To: <3150759.E8ExfKuC24@warperdoze> (Stefan Israelsson Tampe's message of "Fri, 18 Oct 2013 18:21:04 +0200")

Hi,

Just a late observation :)

On Fri 18 Oct 2013 18:21, Stefan Israelsson Tampe <stefan.itampe@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/



      parent reply	other threads:[~2014-03-24 20:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 16:21 vhash speed thread safeness Stefan Israelsson Tampe
2013-10-29 12:34 ` Ludovic Courtès
2013-10-29 14:21   ` Stefan Israelsson Tampe
2013-10-29 17:54     ` Ludovic Courtès
2013-10-29 18:50       ` Ian Price
2014-03-24 20:59 ` Andy Wingo [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=87lhvzuxcf.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=stefan.itampe@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).