This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Guile is becoming as fast as rep


Hello,

I'm a Guile developer, writing a VM and a Scheme compiler for Guile.

John Harper writes:
> Yes, QScheme is fast, especially when calling very small functions
> repeatedly.
> 
> However rep often beats it on `normal` code. E.g. here are some
> benchmarks for my favourite `prime` kernel (from librep/lisp/ChangeLog,
> larger numbers = iterations per minute, so larger = faster):
> 
>         current rep     2580 (1.0)
>         qscheme-0.3.3   1860 (.72)
>         scheme48-0.53   835  (.32)      ; in benchmark mode
>         guile-1.4       314  (.12)      ; with (debug-disable `debug)
> 
> 300MHz mobile Pentium II; code as follows:
> 
> (define (prime n)
>   (letrec ((primep (lambda (n primes)
>                      (or (null primes)
>                          (and (not (zerop (remainder n (car primes))))
>                               (primep n (cdr primes)))))))
>     (let loop ((i 2) (candidate 2) (primes `()))
>       (cond ((not (primep candidate primes)) (loop i (+ 1 candidate) primes))
>             ((= i n) candidate)
>             (t (loop (+ 1 i) (+ 1 candidate) (cons candidate primes)))))))
> 
> (define (test)
>   (let loop ((count 1))
>     (prime 100)
>     (format standard-output "%d" count)
>     (loop (+ 1 count))))

I tried the same benchmark with the current Guile and my VM:

      With byte-compile
        current rep        5706 (1.0)
        Guile with VM      5451 (.96)

      Without byte-compile
        current rep         168 (1.0)
        current Guile       679 (4.0)

on 600MHz PentiumIII.  Hmm, I couldn't beat you...

Anyway, just for your information.

Keisuke Nishida
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]