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]

Re: debug evaluator is faster than regular one?


Keisuke Nishida <kxn30@po.cwru.edu> writes:

> Trying the latest Guile on the CVS, I found that the debug evaluator
> is faster than the regular evaluator:
> 
>   % guile
>   guile> (time (do ((n 1000000 (1- n))) ((< n 0))))
>   clock utime stime cutime cstime gc
>   8.64  8.5   0.14  0      0      6.5

You're running the debug evaluator here as well.

>   % guile --debug
>   guile> (time (do ((n 1000000 (1- n))) ((< n 0))))
>   clock utime stime cutime cstime gc
>   6.76  6.74  0.01  0      0      4.55
> 
> Is this the expected result?

Seems strange.  We should check if this is reproducible and then find
the reason.

The difference between the two cases is that case 1 switches on the
debugging evaluator when the interactive session starts while case 2
has it switched on from the beginning of the boot.

> By the way, I just started writing a VM for Guile.  For now, it seems
> faster than QScheme in this simple example...
> 
>   % echo '(do ((n (* 1000000 100) (1- n))) ((< n 0)))' | time qscheme
>   ; QScheme 0.5.1 - A fast implementation of the Scheme language
>   ; Copyright (C) 1998-2000 Daniel Crettol <dan@sof.ch>
>   ; QScheme is distributed under the GNU General Public Licence.
>   ; See the COPYING and LICENCE_EXCEPTION files for more informations.
>   ;
>   ; Native threads enabled...
>   ;
>   ; macro.scm ok
>   ; sgtk/defextern.scm ok
>   ; s.scm ok
>   QScheme> #t
>   QScheme> 
>   9.97user 0.03system 0:10.03elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
>   0inputs+0outputs (193major+162minor)pagefaults 0swaps
> 
>   % guile-vm
>   guile> (define code (compile '(do ((n (* 1000000 100) (1- n))) ((< n 0)))))
>   guile> (time (vm-run (make-vm) code))
>   clock utime stime cutime cstime gc
>   7.79  7.79  0     0      0      0.03
> 
> Oh, it's about 100 times faster than the current Guile :) (Of course,
> this is a special case.)
> 
> I'll announce this after making closures work...

This is really exciting!  I'm waiting...  8-)

Have you studied the technology used in QScheme before starting work
on your own VM?

/mdj

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