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

Re: Benchmarks



Here's a good benchmark:

(defun nilret () nil)

this is a good test of how fast your lisp returns NIL.

I also like

(defun retjunk (x) (cond((junkp x)  'junk)
				 ((cdr x) (retjunk (car x)))
				 ((= (car x) 'junk) (retjunk (cons (cdr x) (cdr x))))
				 (t (retjunk (cons 'junk x))))

(defun junkp (x) (equal (reverse (explode x)) (reverse (explode
'junk))))


This benchmark measures how fast your lisp can return junk, executing
the retjunk function.

Both of the benchmarks have the adavantage that they are small and can
be abused as benchmarks.