On 4.2.2010 10:41, Alexander Burger wrote:
Hi Kazimir,

http://kazimirmajorinc.blogspot.com/2010/01/picolisp-and-openlisp-new-eval-speed.html

Unfortunately, you do not show the actual PicoLisp code you used. Might
be interesting, also in consideration of possible optimizations.

Sure. I'll post it now to the list. Note that purpose
is not to write the tightest loop in each language, but
to write the code the most similar to generic do loop in
other Lisp dialects. For example, Newlisp has following
primitive designed for benchmarks.

(time <some-code> <number-of-times-to-be-repeated>)

It allows significant speed up in interpreted language,
however, I didn't used it because I thought it would
be unfair to take advantage of the clever primitives in
a benchmark intended to measure the speed of eval.

If Alexander or other PicoLispers can improve the code
in that spirit, I'll be glad to hear.


;-------------------------------------------------------

(prog
(prog (setq u0 (usec))
       (setq i 0)
       (do 1000000
           (setq i (+ i 1))
           (T (= i 1000000))
           (prog (setq x 0)
                 (setq x (+ x 1))))
       (print (format (- (usec) u0) 6) ", "))

(prog (setq u0 (usec))
      (setq i 0)
      (do 1000000
          (setq i (+ i 1))
          (T (= i 1000000))
          '(prog (setq x 0)
                 (setq x (+ x 1))))
      (print (format (- (usec) u0) 6) ", "))

(prog (setq u0 (usec))
      (setq i 0)
      (do 1000000
          (setq i (+ i 1))
          (T (= i 1000000))
          (eval '(prog (setq x 0)
                       (setq x (+ x 1)))))
      (print (format (- (usec) u0) 6) ", "))

(prog (setq u0 (usec))
      (setq i 0)
      (do 1000000
          (setq i (+ i 1))
          (T (= i 1000000))
          (prog (setq x (eval 0))
                (setq x (+ x 1))))
      (print (format (- (usec) u0) 6))))

;-------------------------------------------------------

--
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to