emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ELPA] New package: dired-duplicates


From: Philip Kaludercic
Subject: Re: [ELPA] New package: dired-duplicates
Date: Wed, 01 Nov 2023 17:57:40 +0000

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Visuwesh <visuweshm@gmail.com>
>> Cc: Philip Kaludercic <philipk@posteo.net>,  h.judt@gmx.at,
>>   emacs-devel@gnu.org
>> Date: Wed, 01 Nov 2023 19:23:32 +0530
>> 
>> [புதன் நவம்பர் 01, 2023] Eli Zaretskii wrote:
>> 
>> >> From: Philip Kaludercic <philipk@posteo.net>
>> >> Cc: emacs-devel@gnu.org
>> >> Date: Tue, 31 Oct 2023 12:21:51 +0000
>> >> 
>> > What I would like to ask is whether Harald tried to calculate SHA256
>> > using Emacs's own primitives, instead of relying on an external
>> > program, which may or may not be installed.
>> 
>> >From OP,
>> 
>>     The only external requirement is a checksum program like md5 or
>>     sha256sum that generates a hash value from the contents of a file used
>>     for comparison, because Emacs cannot do that in a performance-efficient
>>     way.
>> 
>> So I guess the answer is no.
>
> I'd like to see the numbers which led to the conclusion that
> performance was prohibitive.
>
> And even if the performance is indeed much worse, it could be a
> fallback in case the program is not available -- which would IMO be
> much better than simply failing to provide the functionality in that
> case.

This is a cheap test on a 1.4GB ISO I had lying around:

--8<---------------cut here---------------start------------->8---
(benchmark-run 1
  (with-temp-buffer
    (insert-file-contents-literally 
"~/Downloads/haiku-r1beta4-x86_64-anyboot.iso")
    (secure-hash 'sha512 (current-buffer))))
;; (44.389091035 1 1.5836082630000021)

(benchmark-run 1
  (with-temp-buffer
    (call-process "sha512sum" nil t nil (expand-file-name 
"~/Downloads/haiku-r1beta4-x86_64-anyboot.iso"))
    (goto-char (point-min))
    (and (looking-at (rx bos (+ alnum)))
         (match-string 0))))
;; (5.155846791 0 0.0)
--8<---------------cut here---------------end--------------->8---



reply via email to

[Prev in Thread] Current Thread [Next in Thread]