From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 483181F934 for ; Tue, 5 Oct 2021 09:40:17 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] extsearchidx: favor 20-byte OID comparison Date: Tue, 5 Oct 2021 09:40:15 +0000 Message-Id: <20211005094017.7285-2-e@80x24.org> In-Reply-To: <20211005094017.7285-1-e@80x24.org> References: <20211005094017.7285-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: As with most of our internal-only code, favor smaller comparisons to reduce memory traffic. --- lib/PublicInbox/ExtSearchIdx.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index eb7c3d67e072..3a1856c84709 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -120,9 +120,8 @@ sub apply_boost ($$) { || $a->[1] <=> $b->[1] # break ties with {xnum} } @$xr3; - my $top_blob = unpack('H*', $xr3->[0]->[2]); my $new_smsg = $req->{new_smsg}; - return if $top_blob ne $new_smsg->{blob}; # loser + return if $xr3->[0]->[2] ne pack('H*', $new_smsg->{blob}); # loser # replace the old smsg with the more boosted one $new_smsg->{num} = $smsg->{num};