bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32728: bug#32729: Xemacs 23 times as fast as GNU Emacs


From: Lars Ingebrigtsen
Subject: bug#32728: bug#32729: Xemacs 23 times as fast as GNU Emacs
Date: Mon, 14 Oct 2019 10:54:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]