José Romero <j...@2.71828.com.ar> writes:

Hi Jose, 
very interesting results. I always had the feeling that even compiled
Elisp is not much faster than PicoLisp, but I thought that was just a
'feeling'. I would like to add your results to the wiki page - let me
know if I shouldn't. 

> On Mon, 23 Apr 2012 02:22:21 +0200
> Thorsten <quintf...@googlemail.com> wrote:
>
>> 
>> Hi List, 
>> out of curiosity I did a little speedtest with PicoLisp and Emacs Lisp
>> on a 64bit Arch Linux (see
>> http://picolisp.com/46850/62704437697738713~!wiki?PILvsEL). 
>> 
>> The results are quite favorable for PicoLisp - it is about 4 times
>> faster than interpreted Emacs Lisp and 2 times faster than compiled
>> Emacs Lisp.
>> 
>
> Nice, I did my own tests on a 32 bit machine, not such a dramatic
> speedup for picolisp by my numbers (about the same speed as bytecode)
> but this thing is only really measuring function call/arithmetic cost.
>
> $ cat > fibo.el << .
>> (defun fibo (N)
>>    (if (> 2 N)
>>       1
>>       (+ (fibo (1- N)) (fibo (- N 2))) ) )
>> 
>> (fibo 35)
>> .
> $ time emacs --no-site-file --script fibo.el 
>
> real  0m13.854s
> user  0m13.829s
> sys   0m0.016s
> $ emacs --no-site-file -batch -f batch-byte-compile fibo.el 
> Wrote /home/cyborgar/tmp/sptest/fibo.elc
> $ time emacs --no-site-file --script fibo.elc
>
> real  0m5.882s
> user  0m5.828s
> sys   0m0.008s
> $ cat > fibo.l << .
>> (de fibo (N)
>>    (if (> 2 N)
>>       1
>>       (+ (fibo (dec N)) (fibo (- N 2))) ) )
>> (fibo 35)
>> .
> $ time pil fibo.l -bye
>
> real  0m5.662s
> user  0m5.624s
> sys   0m0.004s
>
> I tested with the "extensive list manipulations" code Alex tested CLisp
> and SBCL a while back, with pretty nice results also:
>
> $ cat > tst.el << .
>> (defun tst ()
>>   (mapcar
>>    (lambda (X)
>>       (cons
>>        (car X)
>>        (reverse (delete (car X) (cdr X))) ) )
>>    '((a b c a b c) (b c d b c d) (c d e c d e) (d e f d e f)) ) )
>> (dotimes (i 1000000) (tst))
>> .
> $ time emacs --no-site-file --script tst.el 
>
> real  0m8.311s
> user  0m8.273s
> sys   0m0.032s
> $ emacs --no-site-file -batch -f
> batch-byte-compile tst.el Wrote /home/cyborgar/tmp/sptest/tst.elc
> $ time emacs --no-site-file --script tst.elc 
>
> real  0m5.622s
> user  0m5.604s
> sys   0m0.012s
> $ cat > tst.l << .
>> (de tst ()
>>    (mapcar
>>       '((X)
>>         (cons
>>            (car X)
>>            (reverse (delete (car X) (cdr X))) ) )
>>       '((a b c a b c) (b c d b c d) (c d e c d e) (d e f d e f)) ) )
>> (do 1000000 (tst))
>> .
> $ time pil tst.l -bye
>
> real  0m1.208s
> user  0m1.192s
> sys   0m0.012s
>
> Looks like the emacs compiler can't improve much in that function and
> it's still 4.6-6.9x slower than picolisp, whoops :)
>
> $ uname -a
> Linux icz 2.6.32-5-686 #1 SMP Mon Jan 16 16:04:25 UTC 2012 i686
> GNU/Linux 
> $ cat /proc/cpuinfo |grep "model name" | cut -d: -f2
>  Pentium(R) Dual-Core CPU       T4200  @ 2.00GHz
>  Pentium(R) Dual-Core CPU       T4200  @ 2.00GHz
>
> Cheers, 
> José

-- 
cheers,
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to