unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: layer@franz.com, benjamin.benninghofen@airbus.com,
	32729@debbugs.gnu.org, 32728@debbugs.gnu.org
Subject: bug#32728: bug#32729: Xemacs 23 times as fast as GNU Emacs
Date: Sun, 13 Oct 2019 19:36:47 +0200	[thread overview]
Message-ID: <87sgnwbl8w.fsf@gnus.org> (raw)
In-Reply-To: <83r23hkqr3.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 13 Oct 2019 11:13:04 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> No sentinel is called, because the process status doesn't change,
>> typically.  All the relevant network protocols do not close after having
>> "done something" (IMAP, HTTP, etc), but instead use in-protocol markers
>> to say that an operation is done.  So a filter has to be used.
>
> OK, so not in sentinel, but in a timer or somesuch.

A timer wastes resources by triggering work when there's nothing to do,
and conversely, makes network connections sluggish by not having the
code happen immediately when there's data ready.

After thinking about this a bit more, I'm reminded of the problems I had
in this area when doing the NSM, because I really wanted to put a filter
on (some of) the processes, but I couldn't, because we only allow one
filter per process.

So this is the design I want to do:

process-add-callback PROCESS FUNCTION
process-remove-callback PROCESS FUNCTION

FUNCTION takes three parameters: The PROCESS and the start/end of the
region inserted.  Perhaps it would make sense to do something with the
return values -- if the function returns non-nil, then further callbacks
are inhibited?

Anyway, with this, the current filters can trivially be implemented as a
callback instead -- the filters would just be wrapped in a function that
does (funcall filter-function (buffer-substring start end)) so that
we don't need duplicated code for these mechanisms on the C level.  So
set-process-filter and related moves to the Lisp level...

> We could provide a Lisp interface for such cases.  The C
> implementation is in enlarge_buffer_text (but we need to remember the
> decoding of human-readable text, when applicable).
>
> However, I would begin by measuring the effect of this resizing on the
> time it takes to receive large amounts of data.  Maybe other factors
> make this part negligible.

Sure.  My simple dd test (without a filter) surprised me by being as
fast as it was, so Emacs was able to grow that buffer quicker than I
expected.  But it's also a pretty simple test case -- I can try to see
what happens if I call enlarge_buffer_text to 1GB first and see what the
effects are.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2019-10-13 17:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13 13:32 bug#32729: Xemacs 23 times as fast as GNU Emacs Benninghofen, Benjamin Dr.
2019-10-12  3:57 ` Lars Ingebrigtsen
2019-10-12  7:39   ` bug#32728: " Eli Zaretskii
2019-10-12 17:55     ` Lars Ingebrigtsen
2019-10-13  8:13       ` bug#32728: " Eli Zaretskii
2019-10-13 17:36         ` Lars Ingebrigtsen [this message]
2019-10-14  8:18           ` Eli Zaretskii
2019-10-14  8:36             ` bug#32728: " Lars Ingebrigtsen
2019-10-14  9:15               ` Eli Zaretskii
2019-10-13 17:47         ` Lars Ingebrigtsen
2019-10-13 18:46           ` Eli Zaretskii
2019-10-14  8:54             ` Lars Ingebrigtsen
2019-10-14 10:18               ` bug#32728: " Eli Zaretskii
2019-10-25  6:38               ` Benninghofen, Benjamin Dr.
2019-10-25  7:00                 ` Eli Zaretskii
2019-10-13 10:49   ` Phil Sainty
2019-10-13 17:24     ` bug#32728: " Lars Ingebrigtsen
2019-10-13 18:44       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgnwbl8w.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=32728@debbugs.gnu.org \
    --cc=32729@debbugs.gnu.org \
    --cc=benjamin.benninghofen@airbus.com \
    --cc=eliz@gnu.org \
    --cc=layer@franz.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).