tag:blogger.com,1999:blog-5978467133623069001.post4859435099817027172..comments2023-06-02T18:32:19.995-05:00Comments on The Meditative Coder: Clisp PerformanceSteve Fordhttp://www.blogger.com/profile/13692497991649698369noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5978467133623069001.post-19016978045597541052014-09-12T09:22:15.246-05:002014-09-12T09:22:15.246-05:00Heh. Regarding checking the result, no I didn'...Heh. Regarding checking the result, no I didn't. And neither did you. :-) Since the lisp code uses "below", it never adds in the final value. I.e. (fact4 1000) doesn't add in the last 1000, and therefore returns 499500.<br /><br />But that doesn't have a measurable effect on the timing. And I can just call it with 1001 to get the identical answer.<br /><br />Anyway, it appears that the code is working. I'll do some more playing around over the weekend, both with clisp and I'll try out SBCL.Steve Fordhttps://www.blogger.com/profile/13692497991649698369noreply@blogger.comtag:blogger.com,1999:blog-5978467133623069001.post-6249265558753729892014-09-12T07:01:18.093-05:002014-09-12T07:01:18.093-05:00One more thing - did you check that your CLISP fun...One more thing - did you check that your CLISP function is actually returning the correct result? If it's raising an exception, that might explain the relatively constant times.John Jacobsenhttps://www.blogger.com/profile/06696706400559997832noreply@blogger.comtag:blogger.com,1999:blog-5978467133623069001.post-52456458250363489932014-09-12T06:58:54.344-05:002014-09-12T06:58:54.344-05:00Sorry to make you skip your exercise!
I used SBCL...Sorry to make you skip your exercise!<br /><br />I used SBCL (in an Emacs SLIME REPL), and the times seem to scale roughly linearly with the number of iterations.<br /><br />John Jacobsenhttps://www.blogger.com/profile/06696706400559997832noreply@blogger.com