Performance problems
Edi Weitz <[email protected]> Thu, 30 Mar 2006 22:14:22 +0100
| Newsgroups | gmane.lisp.lisa.general |
|---|---|
| Message-ID | <[email protected]> |
Hi!
I'm having severe performance problems using LISA. I tried to create
a very simple test case and it looks like this:
------------------------- file test.lisp -------------------------
(in-package :lisa-user)
(deftemplate foo () (slot foo))
(defvar *counter*)
(defun reset-counter ()
(setq *counter* 0))
(defun make-foo-fact ()
(assert-instance (make-instance 'foo
:foo (incf *counter*))))
(defrule rule-1 ()
(foo (foo ?x))
(foo (foo ?y))
(foo (foo ?z))
=>
(print 'yo))
(defun test (&optional (n 10))
(reset)
(reset-counter)
(dotimes (i n)
(make-foo-fact)))
------------------------- file test.lisp -------------------------
Compile and load the code above and then TIME calls like (TEST 10),
(TEST 20), and so on. On my machine I get the following results
TEST 10: 0.020 s
TEST 20: 0.660 s
TEST 30: 4.596 s
TEST 40: 91.741 s
which clearly demonstrate a hefty exponential growth. This is with
LISA from CVS on LWW 4.4.6 but I've seen similar results when I
double-checked on Linux with CMUCL.
Clearly, my actual rules and facts are more complicated, but they show
similar symptoms. Actually, it's even worse.
Is this expected behaviour or a bug? Or am I doing something wrong?
Thanks,
Edi.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642