From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: hashes
Date: Tue, 5 Apr 2022 23:43:37 +0200 [thread overview]
Message-ID: <CAGua6m27=e7cymEsun2m+BYfpFTquWD3z9inVO8QSAcC5AW2pg@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]
I can now demonstrate that the hash implementation is around as fast as
guile internal implementation. But for some workloads like if we have a
hash with millions of elements. And lookups a working set of about 10000
key hash pairs the speed is doubled compared to guiles internal. Now this
is maybe not as interesting. But the implementation is decoupled and allows
one to construct custom hashing algorithms that are fast compared to
guile's current speed when it comes to the hash tables (hash,eq,assoc) is
never called from the inside of the hash function which means that any
custom implementation lives in scheme totally. The fast execution was
enabled by implementing the hash function as a vm operation and compiling
it with a size 1<<60 (% is efficiently optimized as a logand) and hence we
got essentially the same speed using a vm-op for hashq. Next I will see how
fast we can make hashtables when pushing the hash-ref equivalent to a
vm-operation. With this we can now get a hash algo that mimics the python
algo.
[-- Attachment #2: Type: text/html, Size: 1060 bytes --]
reply other threads:[~2022-04-05 21:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAGua6m27=e7cymEsun2m+BYfpFTquWD3z9inVO8QSAcC5AW2pg@mail.gmail.com' \
--to=stefan.itampe@gmail.com \
--cc=guile-devel@gnu.org \
/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).