all messages for Emacs-related lists mirrored at yhetil.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#32729: Xemacs 23 times as fast as GNU Emacs
Date: Sat, 12 Oct 2019 19:55:54 +0200	[thread overview]
Message-ID: <87y2xplufp.fsf@gnus.org> (raw)
In-Reply-To: <83imouo1jp.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Oct 2019 10:39:22 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> (benchmark-run 1 (call-process "dd" nil (get-buffer-create "
>> *zeroes*") nil "if=/dev/zero" "bs=1000" "count=1000000"))
>> => (4.703641145 0 0.0)
>> 
>> (Note: Don't visit the " *zeroes*" buffer after this, because that will
>> hang Emacs totally.  I guess the long-line display problem hasn't been
>> fixed after all?)
>
> It's unrelated.  Did you try to insert that into a unibyte buffer
> instead?

Nope.  Does Emacs need to do a lot of recomputing when going to
multibyte buffers?

>> And it's a real world problem: When reading data from any network
>> source, you have to use filters because the protocol is usually based on
>> parsing the output to find out when it's over, so you can't use
>> sentinels.
>
> Why can't you use the default filter, and in the sentinel work on the
> buffer with the complete response?

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.

> Please also note that, GC aside, inserting stuff of size that is
> unknown in advance is not free, either: we need to enlarge the buffer
> text each time more stuff arrives.

Yes, I was wondering about that -- how slow is resizing buffers, really?
Does Emacs rely on OS-level realloc that doesn't necessitate actually
copying all that data all the time?

Also -- some of the networking operations know in advance how much data
is going to be received.  For instance, when using non-chunked HTTP
(quite common when fetching "data", i.e., images, PDFs etc), we get the
content size in a header.  Would it make sense to have a way to tell
Emacs about this in advance so that it could pre-size the buffer?

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





  reply	other threads:[~2019-10-12 17:55 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 [this message]
2019-10-13  8:13       ` 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
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=87y2xplufp.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 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.