GNU bug report logs -
#78773
[PATCH] Speedup url-retrieve-synchronously for low-latency connections
Previous Next
Full log
Message #35 received at 78773 <at> debbugs.gnu.org (full text, mbox):
>>>>> 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始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.
Robert
--
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.