unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Benninghofen, Benjamin Dr." <benjamin.benninghofen@airbus.com>
To: Lars Ingebrigtsen <larsi@gnus.org>, Eli Zaretskii <eliz@gnu.org>
Cc: "layer@franz.com" <layer@franz.com>,
	"32729@debbugs.gnu.org" <32729@debbugs.gnu.org>,
	"32728@debbugs.gnu.org" <32728@debbugs.gnu.org>
Subject: bug#32728: bug#32729: Xemacs 23 times as fast as GNU Emacs
Date: Fri, 25 Oct 2019 06:38:16 +0000	[thread overview]
Message-ID: <d4651c91e5c5431d9e78b3bdd4bd5298@CD1-4BDAG02-P03.cdmail.common.airbusds.corp> (raw)
In-Reply-To: <87r23fiu66.fsf@gnus.org>

For me your discussion about the performance problem appears very theoretical.
Why do you not just compare the relevant GNU Emacs Source Code with the Xemacs Source Code?

Benjamin Benninghofen

-----Original Message-----
From: Lars Ingebrigtsen [mailto:larsi@gnus.org] 
Sent: Monday, October 14, 2019 10:54 AM
To: Eli Zaretskii
Cc: layer@franz.com; 32729@debbugs.gnu.org; Benninghofen, Benjamin Dr.; 32728@debbugs.gnu.org
Subject: Re: bug#32729: Xemacs 23 times as fast as GNU Emacs

Actually, my benchmarking is somewhat wrong.

start-process with a filter, but discard output:

(let ((coding-system-for-read 'binary))
  (kill-buffer (get-buffer-create " *zeroes*"))
  (benchmark-run
      1
    (let ((proc (start-process "dd" (get-buffer-create " *zeroes*") "dd"
			       "if=/dev/zero" "bs=4096" "count=250000")))
      (set-process-filter proc (lambda (proc string)))
      (while (and (process-live-p proc)
		  (accept-process-output proc 1))))))
=> (18.828236636 59 13.315468088000017)

filter, but insert the output:

(let ((coding-system-for-read 'binary))
  (kill-buffer (get-buffer-create " *zeroes*"))
  (benchmark-run
      1
    (let ((proc (start-process "dd" (get-buffer-create " *zeroes*") "dd"
			       "if=/dev/zero" "bs=4096" "count=250000")))
      (set-process-filter proc (lambda (proc string)
				 (with-current-buffer (get-buffer " *zeroes*")
				   (goto-char (point-max))
				   (insert string))))
      (while (and (process-live-p proc)
		  (accept-process-output proc 1))))))
=> (21.120281346 59 13.250166416000013)

With the default filter:

(let ((coding-system-for-read 'binary))
  (kill-buffer (get-buffer-create " *zeroes*"))
  (benchmark-run
      1
    (let ((proc (start-process "dd" (get-buffer-create " *zeroes*") "dd"
			       "if=/dev/zero" "bs=4096" "count=250000")))
      (while (and (process-live-p proc)
		  (accept-process-output proc 1))))))
=> (34.046986424 116 26.025843717999976)

(!)

So the default filter is really slow?

Anyway, compare with call-process:

(let ((coding-system-for-read 'binary))
  (kill-buffer (get-buffer-create " *zeroes*"))
  (benchmark-run 1 (call-process "dd" nil (get-buffer-create " *zeroes*") nil "if=/dev/zero" "bs=4096" "count=250000")))
=> (1.694743653 0 0.0)

So what makes start-process 10x slower than call-process?  If it is all
the string creation before calling the filters, default or not, then my
point stands, but this obviously requires a more in-depth dive into
process.c.

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

The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.






  parent reply	other threads:[~2019-10-25  6:38 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
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. [this message]
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4651c91e5c5431d9e78b3bdd4bd5298@CD1-4BDAG02-P03.cdmail.common.airbusds.corp \
    --to=benjamin.benninghofen@airbus.com \
    --cc=32728@debbugs.gnu.org \
    --cc=32729@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).