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-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 384541F9FC for ; Sun, 28 Mar 2021 08:45:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230202AbhC1Ije (ORCPT ); Sun, 28 Mar 2021 04:39:34 -0400 Received: from cloud.peff.net ([104.130.231.41]:34576 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbhC1Iix (ORCPT ); Sun, 28 Mar 2021 04:38:53 -0400 Received: (qmail 2283 invoked by uid 109); 28 Mar 2021 08:38:15 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sun, 28 Mar 2021 08:38:15 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 2224 invoked by uid 111); 28 Mar 2021 08:38:52 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Sun, 28 Mar 2021 04:38:52 -0400 Authentication-Results: peff.net; auth=none Date: Sun, 28 Mar 2021 04:38:51 -0400 From: Jeff King To: Derrick Stolee via GitGitGadget Cc: git@vger.kernel.org, gitster@pobox.com, me@ttaylorr.com, Derrick Stolee , Derrick Stolee , Derrick Stolee Subject: Re: [PATCH v2] csum-file: make hashwrite() more readable Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Mar 26, 2021 at 12:38:11PM +0000, Derrick Stolee via GitGitGadget wrote: > However, during this investigation, I inspected hashwrite() and > misunderstood it, even after looking closely and trying to make it > faster. This change simply reorganizes some parts of the loop within > hashwrite() to make it clear that each batch either uses memcpy() to the > hashfile's buffer or writes directly from the input buffer. The previous > code relied on indirection through local variables and essentially > inlined the implementation of hashflush() to reduce lines of code. Thanks, I think this nicely argues for the change here (and I agree the result, especially with the comments, is much easier to understand). -Peff