5 ms·
One interesting source of data is www.spoj.pl, since they keep records of the runtime of submissions to their site. For example, take a look at the solutions t
by maweaver 17y ago
One interesting source of data is www.spoj.pl, since they keep records of the runtime of submissions to their site.
For example, take a look at the solutions to PRIME 1; the task is to generate a list of prime numbers: http://www.spoj.pl/ranks/PRIME1/ http://www.spoj.pl/ranks/PRIME1/
The top 20 C solutions all take less than 0.05 seconds. The top 20 Java solutions all take less than 0.5 second. Python has several solutions that took 0.55 seconds. But for Lisp, only one user was able to get it to less than 1 second, and then only barely.
There's not enough data to draw any real conclusions, but it does make me skeptical of claims that Lisp is near in speed to Java or C (any Lisp gurus who want to prove me wrong, feel free to code up a fast solution and submit it)
- stefano 17y agoActually, there is a solution that takes 0.52 seconds: http://www.spoj.pl/ranks/PRIME1/lang=LISP%20sbcl http://www.spoj.pl/ranks/PRIME1/lang=LISP%20sbcl
- deleted 17y ago[deleted]
- deleted 17y ago[deleted]
- astine 17y agoThere are two Lisp implementations on www.spoj.pl. One is Clisp which is bytecode compiled and rather slow and the other is SBCL which compiles to machine code and is the implementation used by the OP. It looks as if you only looked at the former as the later has an entry at 0.52 (as mentioned by another commenter.) A note about Common Lisp implementations is that there are many of them, all with different performance specs ideal use cases. Some are considered very fast, such as SBCL and CCL, others, not so much. Most of the data I've seen benchmarking Lisp against other languages uses one of the open source implementations. I'd like to see how a commercial Lisp, such as Allegro or Lispworks, performed, especially since those are the ones that have actually been worked on since the 80s/