about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiDedupe.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-01-29 10:30:41 +0000
committerEric Wong <e@80x24.org>2023-01-30 06:42:31 +0000
commite6aa13bccb7ea5d5b3246b3a944621515905e360 (patch)
tree822309b8cc2ac85ba50acd33deebb03891b0844b /lib/PublicInbox/LeiDedupe.pm
parent9eb8baf199cd148b7ebf8e6e130fb832f4e1ef00 (diff)
downloadpublic-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 'lib/PublicInbox/LeiDedupe.pm')
-rw-r--r--lib/PublicInbox/LeiDedupe.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/LeiDedupe.pm b/lib/PublicInbox/LeiDedupe.pm
index 32f99cd0..22864508 100644
--- a/lib/PublicInbox/LeiDedupe.pm
+++ b/lib/PublicInbox/LeiDedupe.pm
@@ -1,10 +1,10 @@
-# 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>
 package PublicInbox::LeiDedupe;
 use strict;
 use v5.10.1;
 use PublicInbox::ContentHash qw(content_hash git_sha);
-use Digest::SHA ();
+use PublicInbox::SHA ();
 
 # n.b. mutt sets most of these headers not sure about Bytes
 our @OID_IGNORE = qw(Status X-Status Content-Length Lines Bytes);
@@ -30,7 +30,7 @@ sub _oidbin ($) { defined($_[0]) ? pack('H*', $_[0]) : undef }
 
 sub smsg_hash ($) {
         my ($smsg) = @_;
-        my $dig = Digest::SHA->new(256);
+        my $dig = PublicInbox::SHA->new(256);
         my $x = join("\0", @$smsg{qw(from to cc ds subject references mid)});
         utf8::encode($x);
         $dig->add($x);