From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: dired-duplicates Date: Thu, 09 Nov 2023 07:52:25 +0200 Message-ID: <837cmr1nja.fsf@gnu.org> References: <875y2nugm8.fsf@posteo.net> <83edha9mlg.fsf@gnu.org> <87h6m5shpf.fsf@gmail.com> <831qd9a7gg.fsf@gnu.org> <87lebhz78r.fsf@posteo.net> <83sf5p8efg.fsf@gnu.org> <2b30b6e0-d30e-41e1-83a5-05b0c3fa8aa6@gmx.at> <83lebg8zsu.fsf@gnu.org> <715392ae-8ae8-449e-905b-8ff2aa6a2e5a@gmx.at> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5825"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, visuweshm@gmail.com, emacs-devel@gnu.org To: Harald Judt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 09 06:53:31 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0xys-0001HA-RN for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Nov 2023 06:53:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0xy0-0002NU-B8; Thu, 09 Nov 2023 00:52:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0xxy-0002Lc-DA for emacs-devel@gnu.org; Thu, 09 Nov 2023 00:52:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0xxx-0005Nn-NE; Thu, 09 Nov 2023 00:52:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=G+LqO+F19ogTFDDxTBYH0VLLUtRqyFN9SShLwhM+wyI=; b=BJvw1ximRmSp Vtjbc8sBUScTsRWd8huTi7XQRRj4jvvEobVl4r0BoTv6/BZh065TxNj7MyEiIQvq3xeFhsGAy5x8z dlHbMXvTflQMRrGyyMEHbomcohDstjZ77AqWbk+NhpNnFf5vJ2FccxtJnSZSIoVl1CRwp3Cdi/Sf+ Rm0U97PJWzihxO7sdmjaJAPYd/iXu/1dyx23OuLHvqKaxHUWmK+brrrdmRKZrVZQ8ElVCSmUr7B0V bZzX+pN7s87ZXR+c1aj6U+nKO8AsDCrT6Th7sXv4CUWD8to7gA4lOb3etgD4x/4oRPSztFKHK/x1G mwIyz2oliIrUAOsQjpZsVw==; In-Reply-To: <715392ae-8ae8-449e-905b-8ff2aa6a2e5a@gmx.at> (message from Harald Judt on Wed, 8 Nov 2023 21:29:46 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312381 Archived-At: > Date: Wed, 8 Nov 2023 21:29:46 +0100 > Cc: philipk@posteo.net, visuweshm@gmail.com, emacs-devel@gnu.org > From: Harald Judt > > > It is IMO okay to fail when sha256sum is not available and a file is > > larger than the available VM, so Emacs runs out of memory, if this is > > the situation that worries you. But these cases should be relatively > > rare, and so there's no reason to fail to have this feature in the > > much more frequent case that the files are not as large as the > > available VM. > > > > If the file can be read by Emacs, even if it's large, then killing the > > buffer after computing the hash should not have any adverse effects on > > memory usage of that Emacs session. > > I have started to implement the fallback to internal functions, here are my > results - it does even have size-limiting to avoid getting Emacs killed, which > I managed to do trying with a big 4 GiB ISO file: > > https://codeberg.org/hjudt/dired-duplicates/compare/main...fallback-to-internal-checksumming > > Eli, is that how you imagined it? I would be glad if someone could give it a > quick review. Yes, that was the idea I had, thanks. The size limitation should have its default value dependent on whether the build is a 32-bit (which we still support) or 64-bit. You can look at how we compute treesit-max-buffer-size, to figure out how to express the conditions for the default value.