I finally got my development XEmacs to stop core dumping, and there is
visible signs of progress on the faster elisp front:
Here is my generic bytecode benchmark:
(progn
(defun foo (a b c) (bar a b c) (bar a b c) (bar a b c))
(defun bar (d e f) nil)
(byte-compile 'foo)
(byte-compile 'bar)
(race 200000 (foo 1 2 3)))
Martin's development version:
"Elapsed: 23.430829 User: 17.750000 System: 0.000000
"
Function Name Ticks %/Total Call Count
===================== ===== ======= ==========
bar 1164 66.174 600000
foo 518 29.449 200000
measure-compiled-form 77 4.377 1
21.2-b1:
"Elapsed: 33.032012 User: 25.020000 System: 0.000000
"
Function Name Ticks %/Total Call Count
===================== ===== ======= ==========
bar 1586 63.874 600000
foo 799 32.179 200000
measure-compiled-form 98 3.947 1
Benchmarking harness:
(when (not (fboundp 'profile-results))
(defun profile-results (&optional info stream)
(get-profiling-info)
(pretty-print-profiling-info)))
(defmacro measure (&rest body)
`(progn
(let ((oct (current-time))
(opt (current-process-time)))
(garbage-collect)
(clear-profiling-info)
(start-profiling)
,@body
(stop-profiling)
(let ((ct (current-time))
(pt (current-process-time)))
(print (format
"Elapsed: %f User: %f System: %f\n"
(+ (* 65536 (- (first ct) (first oct)))
(- (second ct) (second oct))
(/ (- (third ct) (third oct)) 1000000.0))
(- (first pt) (first opt))
(- (second pt) (second opt))))))
(profile-results)))
(defmacro measure-compiled (&rest body)
`(progn
(defun measure-compiled-form () ,@body)
(byte-compile 'measure-compiled-form)
(measure (measure-compiled-form))
(disassemble 'measure-compiled-form)
(fmakunbound 'measure-compiled-form)))
(defmacro race (times &rest forms)
`(with-output-to-temp-buffer
"*Race*"
,@(mapcar (lambda (form)
`(measure-compiled (dotimes (--race-tmp ,times) ,form)))
forms)))