John Fremlin's blog: PicoLisp takes the performance crown?

Posted 2009-05-26 10:11:00 GMT

Randall Dow kindly pointed me in the direction of a really awesome project called picolisp. (Is it already everything Arc should be?) It's a really concise Lisp dialect with a built-in database. Somehow it is really performant without a compiler, taking the code as data idea so seriously that the (quote ..) operator is used in place of lambda. It also refuses to use strings or arrays as a datatype and includes a flight sim!

This is the kind of no-nonsense, excellent, innovative software that it's a real pleasure to use.

What gives me less pleasure is the discovery that it is faster than tpd2 for serving dynamic webpages.

Using this simple script which Alexander Burger very quickly cooked up,

#!bin/picolisp lib.l
(load "ext.l" "lib/http.l" "lib/xhtml.l")
 (de foo ()
    (html 0 "Hello" NIL NIL
       (ht:Prin "hello " (get 'name 'http)) ) )
 (let (P (port 8080)  H "@foo")
    (setq *Home (cons H (chop H)))
    (loop
       (when (listen P)
          (http @)
          (close @) ) ) )

picolisp achieves around 4.3k requests/second on my humble laptop. As tpd2 only gets 3.8k, it looks like I need to crank out the optimization juice and get back to the drawing board. Congratulations picolisp!

(Unfortunately, picolisp is cheating somewhat, as it can only serve one request at a time in this mode, so one slow client might block all the others. In normal mode it uses a fork mechanism that limits it to 0.7k or so. However the project is so awesome I'm going to overlook this.)

A number of other rather lame contenders have claimed to challenge the tpd2 performance crown but haven't made good on their boasts. I tried a few, but now I'm going to say stop: unless you yourself can at least beat PHP/Lighttpd or something comparable (which is slower than tpd2 according to my tests, at about 3.2k on my laptop), sorry I'm too busy.

UPDATE 20090809 — teepeedee2 is now much faster than PicoLisp.

Actually, PicoLisp surpasses CLISP in the specific test demonstrated simply because it has a different (more compact) object representation, which ironically is why it also holds the distinction of having some of the worst bignum performance imaginable. If this was simply admitted in the article it would be acceptable, but to posit that the speed difference is even remotely related to the list-vs-bytecode comparison is downright misleading.

Posted 2009-05-27 05:34:20 GMT by macdonellba

@macdonellba, it's true that PicoLisp can be beaten by a Lisp that compiles to native code for some things. However, it is a very refreshing take on getting better than interpreted performance out of a language environment. The conventional wisdom is to build some sort of byte-code VM. I like the fact that PicoLisp successfully follows its own path and has its own approach. It can do some things very well, which is more than most small projects.

Posted 2009-05-27 04:18:41 GMT by John Fremlin

You may want to note that PicoLisp it is 'performant without a compiler' as compared to CLISP, which itself lacks a native compiler. The entire PDF article is essentially a refutation of a strawman, which makes it a less-than-satisfying read.

Posted 2009-05-26 20:19:27 GMT by macdonellba

The PicoLisp guy has since posted benchmarks against SBCL at http://www.picolisp.org/5000/-2-F.html

Posted 2010-09-30 01:02:37 GMT by Anonymous from 69.132.111.97

Post a comment