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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, 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 714171F9F4 for ; Fri, 19 Nov 2021 14:45:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235037AbhKSOsa (ORCPT ); Fri, 19 Nov 2021 09:48:30 -0500 Received: from cloud.peff.net ([104.130.231.41]:34888 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234402AbhKSOs3 (ORCPT ); Fri, 19 Nov 2021 09:48:29 -0500 Received: (qmail 8316 invoked by uid 109); 19 Nov 2021 14:45:27 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 19 Nov 2021 14:45:27 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 13160 invoked by uid 111); 19 Nov 2021 14:45:26 -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; Fri, 19 Nov 2021 09:45:26 -0500 Authentication-Results: peff.net; auth=none Date: Fri, 19 Nov 2021 09:45:26 -0500 From: Jeff King To: phillip.wood@dunelm.org.uk Cc: Johannes Schindelin , Derrick Stolee , Phillip Wood via GitGitGadget , git@vger.kernel.org Subject: Re: [PATCH 1/3] diff histogram: intern strings Message-ID: References: <38c771a74d2a348e6a752555f95b746de029b1d7.1637148025.git.gitgitgadget@gmail.com> <2b2bd380-540f-959b-b950-cfdc95cbff29@gmail.com> <88eaee89-4536-fba4-3aa0-c3693f58eae0@gmail.com> <86d38148-7b97-76aa-148b-346cc179615a@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <86d38148-7b97-76aa-148b-346cc179615a@gmail.com> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Nov 19, 2021 at 10:05:32AM +0000, Phillip Wood wrote: > On 18/11/2021 15:42, Jeff King wrote: > > On Thu, Nov 18, 2021 at 04:35:48PM +0100, Johannes Schindelin wrote: > > > > > I think the really important thing to point out is that > > > `xdl_classify_record()` ensures that the `ha` attribute is different for > > > different text. AFAIR it even "linearizes" the `ha` values, i.e. they > > > won't be all over the place but start at 0 (or 1). > > > > > > So no, I'm not worried about collisions. That would be a bug in > > > `xdl_classify_record()` and I think we would have caught this bug by now. > > > > Ah, thanks for that explanation. That addresses my collision concern from > > earlier in the thread completely. > > Yes, thanks for clarifying I should have been clearer in my reply to Stolee. > The reason I was waffling on about file sizes is that there can only be a > collision if there are more than 2^32 unique lines. I think the minimum file > size where that happens is just below 10GB when one side of the diff has > 2^31 lines and the other has 2^31 + 1 lines and all the lines are unique. Right, that makes more sense (and we are not likely to lift the 1GB limit anytime soon; there are tons of 32-bit variables and potential integer overflows all through the xdiff code). It's probably worth explaining this a bit in the commit message. I also, FWIW, found the subject confusing. I expected "intern" to refer to keeping a single copy of some strings. Maybe: Subject: diff histogram: skip xdl_recmatch for comparing records or something? -Peff