From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32728: bug#32729: Xemacs 23 times as fast as GNU Emacs Date: Sat, 12 Oct 2019 10:39:22 +0300 Message-ID: <83imouo1jp.fsf@gnu.org> References: <871rviobu2.fsf@gnus.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="135430"; mail-complaints-to="usenet@blaine.gmane.org" Cc: layer@franz.com, benjamin.benninghofen@airbus.com, 32729@debbugs.gnu.org, 32728@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 12 09:40:16 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 1iJC0d-000Z4v-K2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Oct 2019 09:40:15 +0200 Original-Received: from localhost ([::1]:59388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJC0c-00067I-BY for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Oct 2019 03:40:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50847) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJC0R-00066n-Ik for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2019 03:40:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJC0Q-0007vY-Fi for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2019 03:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJC0Q-0007vT-Cx for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2019 03:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iJC0Q-0001XS-7z for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2019 03:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Oct 2019 07:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32728 X-GNU-PR-Package: emacs Original-Received: via spool by 32728-submit@debbugs.gnu.org id=B32728.15708659825880 (code B ref 32728); Sat, 12 Oct 2019 07:40:02 +0000 Original-Received: (at 32728) by debbugs.gnu.org; 12 Oct 2019 07:39:42 +0000 Original-Received: from localhost ([127.0.0.1]:60675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJC05-0001Wl-Vj for submit@debbugs.gnu.org; Sat, 12 Oct 2019 03:39:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJC03-0001WS-A7; Sat, 12 Oct 2019 03:39:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iJBzx-0007ld-Ko; Sat, 12 Oct 2019 03:39:33 -0400 Original-Received: from [176.228.60.248] (port=2912 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iJBzx-0001eq-2w; Sat, 12 Oct 2019 03:39:33 -0400 In-reply-to: <871rviobu2.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 12 Oct 2019 05:57:09 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:169031 Archived-At: > From: Lars Ingebrigtsen > Date: Sat, 12 Oct 2019 05:57:09 +0200 > Cc: Kevin Layer , 32729@debbugs.gnu.org, 32728@debbugs.gnu.org > > (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? > So it would seem that the Emacs filter method is just unnecessarily > slow, which I've long suspected. Creating the strings before calling > the filter is probably what's taking quite a bit of this time, but the > rest is taken up by garbage collecting as it spends 13 of these 20 > seconds doing that. > > 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? 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. > So for Emacs 28 I want to explore adding a new type of filter to > processes: One that doesn't take a string argument, but which just > inserts the data into the buffer, and then calls the filter with the > region positions of what was inserted, which is just as powerful, but > should allow streams to be 10x more efficient. Doesn't the default filter already do that?