I did send an email with the same subject earlier, but its attachment was probably lost.
Now I inserted the contents of the attachments in the email text.
The versions of Xemacs and GNU Emacs are those that come with RHEL 7.5.
To reproduce the benchmark:
Evaluate this in Emacs-Lisp
(defun demo ()
(interactive)
(let ((buffer (get-buffer-create "*demo*"))
proc)
(switch-to-buffer buffer)
(erase-buffer)
(setq proc (start-process "demo" buffer "~/prog.sh"))
(set-process-filter proc 'demo-process-filter)))
(defun demo-process-filter (process output)
(let* ((xmarker (process-mark process))
(marker (if (marker-position xmarker)
xmarker
(set-marker (make-marker) 0 buffer)))
(marker-point (marker-position marker)))
(goto-char marker-point)
(insert output)
(set-marker marker (point))))
Place a file "prog.sh" with the contents below in the home directory:
#! /bin/bash
start=$(date +%s)
echo sleeping 5 to wait for process filter to get installed...
sleep 5
while read line; do
echo $line
done <<< "$(cat input.txt)"
end=$(date +%s)
echo duration: $(( end - start )) seconds
Furthermore a large text file "input.txt" is needed in the home directory. The file should have 1000000 lines, each line longer than 80 characters.
The file I used was created with the following ANSI-COMMON-LISP function:
(defun print-nums (&key (first 1) (last 1000000))
(check-type first fixnum)
(check-type last fixnum)
(loop for k of-type fixnum from first to last do (format t "~%~B ^3 = ~B" k (expt k 3)))
t)
Alternatively the "input.txt" file can be created as follows:
#! /bin/bash
last=1000000
function base2 {
echo "obase=2;$1" | bc
}
for k in $(seq 1 $last); do
x=$(( k * k * k ))
echo $(base2 $k) '^3 =' $(base2 $x)
done
generate the input like this:
$ ./gen.sh > input.txt
The benchmark is executed by
(M-x) demo
At the end the time is printed and I received the following results:
Xemacs : 51 seconds
GNU Emacs : 1205 seconds
So the Xemacs is more than 23 times as fast as the GNU Emacs.
---
Benjamin Benninghofen