diff options
author | Eric Wong <e@80x24.org> | 2023-01-29 10:30:41 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-01-30 06:42:31 +0000 |
commit | e6aa13bccb7ea5d5b3246b3a944621515905e360 (patch) | |
tree | 822309b8cc2ac85ba50acd33deebb03891b0844b /xt/imapd-validate.t | |
parent | 9eb8baf199cd148b7ebf8e6e130fb832f4e1ef00 (diff) | |
download | public-inbox-e6aa13bccb7ea5d5b3246b3a944621515905e360.tar.gz |
On my x86-64 machine, OpenSSL SHA-256 is nearly twice as fast as the Digest::SHA implementation from Perl, most likely due to an optimized assembly implementation. SHA-1 is a few percent faster, too.
Diffstat (limited to 'xt/imapd-validate.t')
-rw-r--r-- | xt/imapd-validate.t | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xt/imapd-validate.t b/xt/imapd-validate.t index 5d27d2a0..5d665fa9 100644 --- a/xt/imapd-validate.t +++ b/xt/imapd-validate.t @@ -1,11 +1,12 @@ #!perl -w -# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # Expensive test to validate compression and TLS. use strict; use v5.10.1; use Symbol qw(gensym); use PublicInbox::DS qw(now); +use PublicInbox::SHA; use POSIX qw(_exit); use PublicInbox::TestCommon; my $inbox_dir = $ENV{GIANT_INBOX_DIR}; @@ -64,7 +65,7 @@ my $do_get_all = sub { my ($desc, $opt) = @_; local $SIG{__DIE__} = sub { print STDERR $desc, ': ', @_; _exit(1) }; my $t0 = now(); - my $dig = Digest::SHA->new(1); + my $dig = PublicInbox::SHA->new(1); my $mic = $imap_client->new(%$opt); $mic->examine($mailbox) or die "examine: $!"; my $uid_base = 1; |