From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.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: Mon, 14 Oct 2019 12:15:09 +0300 [thread overview]
Message-ID: <8336fvk7s2.fsf@gnu.org> (raw)
In-Reply-To: <87v9sriv0k.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 14 Oct 2019 10:36:11 +0200)
> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: benjamin.benninghofen@airbus.com, layer@franz.com,
> 32729@debbugs.gnu.org, 32728@debbugs.gnu.org
> Date: Mon, 14 Oct 2019 10:36:11 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > I don't understand what would trigger these callbacks, and how do you
> > specify the region in advance, without knowing what will be inserted.
>
> accept_process_output inserts the data into the buffer and then calls
> the callback with the region in question. Well,
> read_and_dispose_of_process_output, I guess...
Filter functions are called even if the Lisp program never calls
accept-process-output, so your proposal doesn't seem to be equivalent
to what we have now, right?
OTOH, if one has to call accept-process-output, then why do we need
callbacks? Just extend accept-process-output to call a function with
the received output. No?
> > Without understanding this, I don't think I see the utility, and most
> > important: why this would be faster.
>
> It would avoid creating (and garbaging) the strings.
I'm not sure I see how.
The way it works now is that we get the process output as a C string;
we then decode it and make a Lisp string from the result of decoding;
and then we invoke the filter with that Lisp string. (If the filter
is nil, we invoke internal-default-process-filter instead, but it
still gets the text as a string.)
Which part(s) of this will be avoided under your proposal?
> > Btw, unlike what I originally implied, the default filter also
> > receives a Lisp string, so the question why by default reading dd
> > output is so much faster than when you define a non-default filter
> > function still stands.
>
> Oh! That is curious indeed. Are the Lisp_Object strings somehow
> ... special here when they never leave C land?
No, I don't think so.
> The speed differential is completely repeatable... hm... Is the
> only difference that gc isn't given a chance to run in the
> non-filter case?
You could test that hypothesis by setting gc-cons-threshold to a very
high value.
Bottom line: I think we must understand better what takes the time in
your last test case, before we discuss solutions. I'd start by
profiling that with "M-x profiler-start".
next prev parent reply other threads:[~2019-10-14 9:15 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
2019-10-14 8:18 ` Eli Zaretskii
2019-10-14 8:36 ` bug#32728: " Lars Ingebrigtsen
2019-10-14 9:15 ` Eli Zaretskii [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8336fvk7s2.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=32728@debbugs.gnu.org \
--cc=32729@debbugs.gnu.org \
--cc=benjamin.benninghofen@airbus.com \
--cc=larsi@gnus.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.