Use a queues instead of lists for the logic frame pending predicates
I wonder if this is ACTUALLY faster, since often there will probably only be
a couple of entries in a particular predicate's list? But then again there are
some HUGE predicates (e.g. successor relations), so it'll benefit us there.
Either way, conceptually the thing should be FIFO, so as long as using queues
doesn't COST us performance I'm happy.
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 05 Jul 2016 23:37:14 +0000 |
parents |
410acaae0c14 |
children |
a3466a551136 |
(ql:quickload 'bones)
(load "examples/ggp-wam.lisp")
(require :sb-sprof)
(in-package :bones.wam)
(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)
(load "examples/ggp-wam.lisp")))
(defun run-profile ()
(reload)
(format t "PROFILING -------------------------------~%")
; (sb-sprof:profile-call-counts "COMMON-LISP")
(sb-sprof:profile-call-counts "BONES.WAM")
(sb-sprof:profile-call-counts "BONES.QUICKUTILS")
(sb-sprof:with-profiling (:max-samples 5000
:sample-interval 0.0005
:loop nil)
(bones.wam::depth-first-search :exhaust t))
(sb-sprof:report :type :flat)
)
; (format t "~%~%====================================~%")
; (format t "(speed 3) (safety 1) (debug 1)~%")
; (declaim (optimize (speed 3) (safety 1) (debug 1)))
; (run-test)
; (format t "~%~%====================================~%")
; (format t "(speed 3) (safety 1) (debug 0)~%")
; (declaim (optimize (speed 3) (safety 3) (debug 3)))
; (run-profile)
; (format t "~%~%====================================~%")
; (format t "(speed 3) (safety 0) (debug 0)~%")
(declaim (optimize (speed 3) (safety 0) (debug 0)))
(run-profile)