From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#32729: Xemacs 23 times as fast as GNU Emacs Date: Sat, 12 Oct 2019 19:55:54 +0200 Message-ID: <87y2xplufp.fsf@gnus.org> References: <871rviobu2.fsf@gnus.org> <83imouo1jp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="263278"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: layer@franz.com, benjamin.benninghofen@airbus.com, 32729@debbugs.gnu.org, 32728@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 12 19:57:56 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iJLeO-0016Is-Mz for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Oct 2019 19:57:56 +0200 Original-Received: from localhost ([::1]:35214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJLeN-0004iO-8i for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Oct 2019 13:57:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40390) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJLdX-0004eN-Me for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2019 13:57:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJLdW-0006p4-Ar for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2019 13:57:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJLdW-0006p0-8O for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2019 13:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iJLdW-0001uj-6W for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2019 13:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Oct 2019 17:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32729 X-GNU-PR-Package: emacs Original-Received: via spool by 32729-submit@debbugs.gnu.org id=B32729.15709029637267 (code B ref 32729); Sat, 12 Oct 2019 17:57:02 +0000 Original-Received: (at 32729) by debbugs.gnu.org; 12 Oct 2019 17:56:03 +0000 Original-Received: from localhost ([127.0.0.1]:34099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJLcZ-0001t4-9p for submit@debbugs.gnu.org; Sat, 12 Oct 2019 13:56:03 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:36670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJLcV-0001sV-BU; Sat, 12 Oct 2019 13:56:01 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iJLcQ-0006TB-IJ; Sat, 12 Oct 2019 19:55:57 +0200 In-Reply-To: <83imouo1jp.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Oct 2019 10:39:22 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169045 Archived-At: Eli Zaretskii 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