From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67D24C433E9 for ; Tue, 9 Feb 2021 21:46:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4212864EE0 for ; Tue, 9 Feb 2021 21:46:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233884AbhBIVpJ (ORCPT ); Tue, 9 Feb 2021 16:45:09 -0500 Received: from pb-smtp20.pobox.com ([173.228.157.52]:54153 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234393AbhBIVPG (ORCPT ); Tue, 9 Feb 2021 16:15:06 -0500 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 8E859124EE1; Tue, 9 Feb 2021 16:14:21 -0500 (EST) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=H4FMWlyCA4sumXVQd8SxWFhmKcY=; b=qU6WKp N1mt0XrA8okCYuizYwHghHXmE6P34xObjfUNUZewJbEhOj0P+HfC+CxxnYk73Bvt Qu1JIpCxxHuk9yefMhnxssEjt49D/QhOBvjNirwx15I1wTqAA5kXlWcagxFjlWmh t6tHimuzkY2vhTcvBgFbsTnBYfmF3UQaaEhsU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=sSPtpy3uvkSGxZfOIbn2hwe1fx/+V3yK Vx9a2dMrEk4l18+89lR1m5hYeQ1S61T2EDmq2Qd9Z6IxJBjmgK69MgAUX3LFMKvj ioSSXh8jB+PdbB0lW548C0YwtBMKUsy8uR8Bz/dT1U9HAKn0b8hn8y7WvE3lPTVF XszuvpvSTnU= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 881FE124EE0; Tue, 9 Feb 2021 16:14:21 -0500 (EST) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id CD18A124EDC; Tue, 9 Feb 2021 16:14:18 -0500 (EST) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: git@vger.kernel.org, Kyle Meyer , Eric Sunshine , Taylor Blau Subject: Re: [PATCH v2] rev-list --disk-usage References: Date: Tue, 09 Feb 2021 13:14:17 -0800 In-Reply-To: (Jeff King's message of "Tue, 9 Feb 2021 06:09:34 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: C59C1894-6B1B-11EB-9FEA-E43E2BB96649-77302942!pb-smtp20.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > I don't know that it's really worth digging into that much, though it's > quite possible there may be some easy wins by optimizing those memcpy > calls. E.g., I'm not sure if the compiler ends up inlining them or not. > If it doesn't realize that the_hash_algo->rawsz is only ever "20" or > "32", we could perhaps help it along with specialized versions of > hashcpy(). If somebody does want to play with it, this patch may make a > good testbed. :) Yuck. That reminds me of the adventure Shawn he made in the Java land benchmarking which one among int[5], int a,b,c,d,e, char[40] is the most efficient way (both storage-wise and performance-wise) to store SHA-1 hash. I wish we didn't have to go there. It indeed is an interesting, despite a bit sad, observation that even with a good precomputed information, an overly heavy interface can kill potential performance benefit. Thanks.