GNU bug report logs - #78773
[PATCH] Speedup url-retrieve-synchronously for low-latency connections

Previous Next

Package: emacs;

Reported by: Steven Allen <steven <at> stebalien.com>

Date: Thu, 12 Jun 2025 04:10:02 UTC

Severity: normal

Tags: patch

Full log


Message #38 received at 78773 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 78773 <at> debbugs.gnu.org, larsi <at> gnus.org, steven <at> stebalien.com
Subject: Re: bug#78773: [PATCH] Speedup url-retrieve-synchronously for
 low-latency connections
Date: Fri, 13 Jun 2025 13:48:08 +0300
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  78773 <at> debbugs.gnu.org,  larsi <at> gnus.org
> Date: Fri, 13 Jun 2025 10:58:07 +0200
> 
> >>>>> On Thu, 12 Jun 2025 13:54:01 -0700, Steven Allen <steven <at> stebalien.com> said:
> 
>     Steven> Ok, I think I've figured it out. We loop twice and wait on a timeout
>     Steven> (READ_OUTPUT_DELAY_INCREMENT) the second loop because we're already done
>     Steven> reading.
> 
>     Steven> The first time through, we hit the following, recording that we've
>     Steven> gotten some output:
> 
>     Steven>   https://cgit.git.savannah.gnu.org/cgit/emacs.git/tree/src/process.c?h=81a3e4e51167be51c63eae682331210bc62f7280#n5974
> 
> 
>     Steven> We hit the following, setting our timeout to READ_OUTPUT_DELAY_INCREMENT:
> 
>     Steven>   https://cgit.git.savannah.gnu.org/cgit/emacs.git/tree/src/process.c?h=81a3e4e51167be51c63eae682331210bc62f7280#n5679
> 
>     Steven> Then we hit the select call and wait the full timeout (nothing to read)
>     Steven> and we finally exit here (because our timeout has passed):
> 
>     Steven>   https://cgit.git.savannah.gnu.org/cgit/emacs.git/tree/src/process.c?h=81a3e4e51167be51c63eae682331210bc62f7280#n5832
> 
>     Steven> ***
> 
>     Steven> I think what we need to do is modify:
> 
>     Steven>   https://cgit.git.savannah.gnu.org/cgit/emacs.git/tree/src/process.c?h=81a3e4e51167be51c63eae682331210bc62f7280#n5978
> 
>     Steven> from
> 
>     Steven>     		  if (wait_proc == XPROCESS (proc))
>     Steven> 		    wait = MINIMUM;
> 
>     Steven> to
> 
>     Steven>     		  if (!wait_proc || wait_proc == XPROCESS (proc))
>     Steven> 		    wait = MINIMUM;
> 
>     Steven> So that we set the timeout to 0 here:
> 
>     Steven>   https://cgit.git.savannah.gnu.org/cgit/emacs.git/tree/src/process.c?h=81a3e4e51167be51c63eae682331210bc62f7280#n5439
> 
>     Steven> And exit early.
> 
> That analysis looks correct to me. It works for the original test
> case, at least.

I didn't yet have time to look into this closely enough to have an
opinion.

> I始m wondering why we始re setting the timeout to zero and calling
> `pselect' again, which means recomputing the wait set again, if I
> haven始t gotten lost in the twisty maze of if始s and global variables
> 馃榾. We始ve got input, why can始t we just `break'? There might be some
> work we don始t do, but that will get done the next time
> `wait_reading_process_output' is called.

Try looking at the Git history of this code, maybe it will tell you
how this code evolved, and bring up past discussions and bug reports
which caused us to make the code as it is today.




This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.