begin  quoting Andrew Lentvorski as of Sat, Jan 12, 2008 at 03:56:32PM -0800:
[snip]
> However, if you type it in from the repl, you've already sunk the 
> compilation time.  Calling it from the command line forces you to add 
> the compilation time to the actual execution time.

I'm using clisp (on rohan) -- is there a way to compile it to something
that runs from the command-line?

Hm... I could count compiling the C code as part of the runtime.

Script started on Sat Jan 12 18:08:05 2008
rohan% tail -6 puzzle.cl

(defvar sample-board (make-board '(5 4 3 2 1 nil 8 6 7)))

;(time (solve '(1 2 3 4 5 6 7 8 nil )))
;(time (solve '(nil 1 2 3 4 5 6 8 7 )))
(time (solve sample-board) )
rohan% time clisp puzzle.cl
Real time: 36.984585 sec.
Run time: 36.98334 sec.
Space: 41246096 Bytes
GC: 37, GC time: 1.409856 sec.
36.67u 0.36s 0:37.05 99.9%
rohan% exit
exit

script done on Sat Jan 12 18:09:07 2008

versus

Script started on Sat Jan 12 18:13:58 2008
rohan% cat compile-and-run
#!/bin/csh -f
gcc sliding_nine.c >& /dev/null
# match solution: '(5 4 3 2 1 nil 8 6 7)))
./a.out '54321 867' '12345678 ' > /dev/null
rohan% time ./compile-and-run
1.35u 0.06s 0:01.48 95.2%
rohan% exit
exit

script done on Sat Jan 12 18:14:15 2008

-- 
It's hard enough making a comment pithy
Making it rhyme is hard so as to be mythy.
Stewart Stremler

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to