examples/bench.lisp @ 970e21fa14b0

Implement anonymous variables and the `*_void` opcodes

That was more difficult than I expected.  The shitty part was that we have to
thread the anonymous variables way the hell down into the register allocation
phase.  I took the opportunity to refactor a bit so further things like this
shouldn't be quite so bad.
author Steve Losh <steve@stevelosh.com>
date Mon, 04 Jul 2016 23:35:08 +0000
parents 72bbdd515725
children 410acaae0c14
(ql:quickload 'bones)
(ql:quickload 'paiprolog)

(load "examples/ggp-paip-compiled.lisp")
(load "examples/ggp-paip-interpreted.lisp")
(load "examples/ggp-wam.lisp")

(in-package :bones)

(defun reload ()
  (let ((*standard-output* (make-broadcast-stream))
        (*debug-io* (make-broadcast-stream))
        (*terminal-io* (make-broadcast-stream))
        (*error-output* (make-broadcast-stream)))
    (asdf:load-system 'bones :force t)
    (asdf:load-system 'paiprolog :force t)
    (load "examples/ggp-paip-compiled.lisp")
    (load "examples/ggp-paip-interpreted.lisp")
    (load "examples/ggp-wam.lisp")))

(defun run-test% ()
  ; (format t "PAIP (Compiled) --------------------~%")
  ; (time (paiprolog-test::dfs-exhaust))

  ; (format t "PAIP (Interpreted) -----------------~%")
  ; (time (bones.paip::dfs-exhaust))

  (format t "WAM --------------------------------~%")
  (time (bones.wam::dfs-exhaust)))

(defmacro run-test (&rest settings)
  `(progn
    (declaim (optimize ,@settings))
    (format t "~%~%========================================================~%")
    (format t "~S~%" ',settings)
    (format t "--------------------------------------------------------~%")
    (reload)
    (run-test%)))

; (run-test (speed 3) (safety 1) (debug 1))
(run-test (speed 3) (safety 0) (debug 0))