unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Nala Ginrut <nalaginrut@gmail.com>
To: "Göran Weinholt" <goran@weinholt.se>
Cc: "Andy Wingo" <wingo@igalia.com>, "Ludovic Courtès" <ludo@gnu.org>,
	"Guile Devel" <guile-devel@gnu.org>
Subject: Re: SHA256 performance with Guile 2.2 vs. Guile 3.0
Date: Sat, 4 Jan 2020 23:51:11 +0800	[thread overview]
Message-ID: <CAPjoZocMBWRYGK7K0pVU4wqPbSCDPVpi84URdETWp8+zi0OWWA@mail.gmail.com> (raw)
In-Reply-To: <87h81b7bym.fsf@teapot.weinholt.se>

[-- Attachment #1: Type: text/plain, Size: 2035 bytes --]

Congrats!
I just replaced Weinholt's hmac implementation with NSS binding for product
consideration, but nice to know this great result! And thanks to Weinholt's
work, Artanis had been relying on it for many years.

Best regards.


On Sat, Jan 4, 2020, 18:36 Göran Weinholt <goran@weinholt.se> wrote:

> Ludovic Courtès <ludo@gnu.org> writes:
>
> > Ludovic Courtès <ludo@gnu.org> skribis:
> >
> >> ludo@ribbon ~/src/guix$ ./pre-inst-env guix environment --pure
> --ad-hoc guile-next guile3.0-hashing -- guile ~/tmp/sha256.scm
> >>
> >> ;;; (hash
> "b33576331465a60b003573541bf3b1c205936a16c407bc69f8419a527bf5c988")
> >> clock utime stime cutime cstime gctime
> >> 65.17 89.75  0.45   0.00   0.00  35.63
> >
> > The patch below gives us:
> >
> > ludo@ribbon /tmp/hashing$ guile --r6rs -L .. ~/tmp/sha256.scm
> >
> > ;;; (hash
> "b33576331465a60b003573541bf3b1c205936a16c407bc69f8419a527bf5c988")
> > clock utime stime cutime cstime gctime
> > 59.31 80.65  0.39   0.00   0.00  30.73
> >
> > It’s a disappointingly small improvement.  The reason is that (hashing
> > fixnums) adds another layer of opacity, where it ends up doing
> > essentially:
> >
> >   (define fx32xor fxxor)
> >   …
> >
> > Thus, no inlining, and no easy trick to solve that.  :-/
>
> I've pushed a Guile-specific version of (hashing fixnums) that inlines
> the generic arithmetic procedures. This and some other small changes
> improved the runtime:
>
>            clock utime stime cutime cstime gctime
>  before:
>     2.2.6  31.06 32.61  0.03   0.00   0.00   1.38
>     2.9.8  15.55 16.23  0.01   0.00   0.00   1.19
>  after:
>     2.2.6   2.95  3.01  0.00   0.00   0.00   0.10
>     2.9.8   1.98  1.99  0.00   0.00   0.00   0.08
>
> That's about 100 times slower than sha256sum from coreutils. You might
> get some more performance out of it by unrolling the loop in
> sha-256-transform!.
>
> Regards,
>
> --
> Göran Weinholt   | https://weinholt.se/
> Debian developer | 73 de SA6CJK
>
>

[-- Attachment #2: Type: text/html, Size: 2890 bytes --]

  reply	other threads:[~2020-01-04 15:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03 23:55 SHA256 performance with Guile 2.2 vs. Guile 3.0 Ludovic Courtès
2020-01-04  0:40 ` Ludovic Courtès
2020-01-04 10:28   ` Göran Weinholt
2020-01-04 15:51     ` Nala Ginrut [this message]
2020-01-04 21:39     ` Arne Babenhauserheide
2020-01-05 14:28       ` Göran Weinholt
2020-01-06  9:37     ` Ludovic Courtès
2020-01-05  9:48   ` Andy Wingo
2020-01-06  9:47     ` Ludovic Courtès
2020-01-06 19:52       ` Andy Wingo
2020-01-07 11:08         ` Ludovic Courtès
2020-01-07 21:45           ` Andy Wingo
2020-01-07 22:59             ` Ludovic Courtès

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=CAPjoZocMBWRYGK7K0pVU4wqPbSCDPVpi84URdETWp8+zi0OWWA@mail.gmail.com \
    --to=nalaginrut@gmail.com \
    --cc=goran@weinholt.se \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=wingo@igalia.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).