emacs-devel
[Top][All Lists]
Advanced

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

Re: Sv: Emacs HTTP libraries [was: Re: How to contribute new package to


From: Clément Pit-Claudel
Subject: Re: Sv: Emacs HTTP libraries [was: Re: How to contribute new package to GNU ELPA?]
Date: Tue, 30 Mar 2021 12:49:25 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 3/30/21 12:21 PM, Eli Zaretskii wrote:
>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>> Date: Tue, 30 Mar 2021 12:13:55 -0400
>>
>>>   (benchmark-run 1 (url-retrieve-synchronously
>>>                     "https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz";))
>>>
>>> in Emacs, and compared that with download by wget.  On my relatively
>>> slow home connection I get almost the same times, down to less than
>>> 2%.
>>
>> On my decently fast home connection, Emacs takes 4.5s-5s to download that 
>> file using the form you posted, and wget takes 1.4s-2s to download the same 
>> file:
>>
>> (benchmark-run 1 (url-retrieve-synchronously 
>> "https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz";))
>> ⇒ (4.875848555 13 3.7572300619999623)
> 
> But note that the actual Emacs download time was 4.876 - 3.757 = 1.319
> sec, the rest was taken by GC.  What happens if you set
> gc-cons-threshold to a very large value?

Good point:

(let ((gc-cons-threshold (expt 2 32)))
  (benchmark-run 1 (url-retrieve-synchronously 
"https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz";)))
⇒ (3.181631628 0 0.0)
⇒ (1.46930467 0 0.0)

> Also, nowadays we have a variable to tune how much stuff do we read in
> one go (by default just 4K), so might as well test the effect of that
> on download times.

You're completely right:

(let ((gc-cons-threshold (expt 2 32))
      (read-process-output-max (expt 2 22)))
  (benchmark-run 1 (url-retrieve-synchronously
                      "https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz";)))
⇒ (1.446506607 0 0.0)
⇒ (2.441543274 0 0.0)

Adding back GC:

(let ((read-process-output-max (expt 2 22)))
  (benchmark-run 1 (url-retrieve-synchronously
                      "https://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.xz";)))
⇒ (2.719771409 7 1.9299083920000157)

Although, to be fair, I'm not sure what to make of these numbers.  With the GC 
change only, for example, Emacs reports 1.45s after freezing for 7 to 8 
seconds, not 1.45 — I guess that's because the GC runs after the benchmarking 
completes?

Clément.



reply via email to

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