From ... Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!opentransit.net!jussieu.fr!univ-lyon1.fr!nmaster.kpnqwest.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Beginner question: performance problems with a simple program References: <3218471295676491@naggum.net> <5CLW7.10$Ip1.36718@burlma1-snr2> Mail-Copies-To: never From: Erik Naggum Message-ID: <3218634538190945@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 35 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 29 Dec 2001 17:09:00 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1009645740 193.71.66.49 (Sat, 29 Dec 2001 18:09:00 MET) NNTP-Posting-Date: Sat, 29 Dec 2001 18:09:00 MET Xref: archiver1.google.com comp.lang.lisp:23307 * Janosch Zwerensky | I just compared the two programs again, doing the equivalent of | evaluating (iterative-max-list 100000000) in both Lisp and C. I get | runtimes of 746 seconds for Lisp versus 33.5 seconds for C, which is a | 22:1 disadvantage for Lisp :(... Do they return the same results? It may sound like a stupid question, but you would probably be surprised to learn hown often a C solution is _much_ faster than a Common Lisp solution, but also very, very wrong. If I want wrong results, I can get that far faster than 33.5 seconds. :) I think you have run into the bignum cost in Common Lisp. Although arbitrarily-sized integers is a major feature of the language, some implementations have not made a particular point of making bignums very efficient, despite the availability of very high-performance libraries. I find this sufficiently annoying that I have complained about it several times, but there is apparently no commercial value in fast bignums, and since I do not want to pay for reimplementing mp libraries, nor anybody else, it seems, nothing happens. You could try CLISP to see if it can give you a significant performance improvement, but I doubt that you can beat a 64-bit integer if you have the hardware support for it. Most bignum libraries use 16- or 32-bit "bigits" and it is hard to make that as fast as a known size. It would have been so great if Common Lisp implementations could use machine integers if bindings/slots, etc, were so declared, but it would probably make garbage collection slightly harder and more expensive. /// -- The past is not more important than the future, despite what your culture has taught you. Your future observations, conclusions, and beliefs are more important to you than those in your past ever will be. The world is changing so fast the balance between the past and the future has shifted.