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: Mon, 14 Oct 2019 12:15:09 +0300 Message-ID: <8336fvk7s2.fsf@gnu.org> References: <871rviobu2.fsf@gnus.org> <83imouo1jp.fsf@gnu.org> <87y2xplufp.fsf@gnus.org> <83r23hkqr3.fsf@gnu.org> <87sgnwbl8w.fsf@gnus.org> <83blujkaf8.fsf@gnu.org> <87v9sriv0k.fsf@gnus.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="41549"; 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 Mon Oct 14 11:17:27 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 1iJwTm-000Acx-Uy for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Oct 2019 11:17:27 +0200 Original-Received: from localhost ([::1]:46136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJwTl-0006iU-04 for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Oct 2019 05:17:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59988) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJwSS-0006Ib-01 for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2019 05:16:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJwSQ-0002Mw-OH for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2019 05:16:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57555) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJwSQ-0002Mm-L2 for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2019 05:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iJwSQ-0007Ui-EQ for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2019 05:16: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: Mon, 14 Oct 2019 09:16: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.157104452528749 (code B ref 32728); Mon, 14 Oct 2019 09:16:02 +0000 Original-Received: (at 32728) by debbugs.gnu.org; 14 Oct 2019 09:15:25 +0000 Original-Received: from localhost ([127.0.0.1]:38141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJwRo-0007Tc-MJ for submit@debbugs.gnu.org; Mon, 14 Oct 2019 05:15:24 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJwRm-0007TI-SG; Mon, 14 Oct 2019 05:15:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iJwRh-0001hX-28; Mon, 14 Oct 2019 05:15:17 -0400 Original-Received: from [176.228.60.248] (port=2273 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iJwRg-0006dy-CZ; Mon, 14 Oct 2019 05:15:16 -0400 In-reply-to: <87v9sriv0k.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 14 Oct 2019 10:36:11 +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:169249 Archived-At: > From: Lars Ingebrigtsen > 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 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".