This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: guile-vm-0.0
Keisuke Nishida <kxn30@po.cwru.edu> writes:
> Okay, I added the optimization. I added a new instruction %tail-call,
> which efficiently handles tail calls.
Great! I am becoming convinced that a byte-code interpreter is easier
to make fast than a tree-code interpreter. After implementing builtin
versions of "<" and "+" for two arguments, my evaluator is about 20%
faster than Guile's regular non-debugging evaluator. Going further
would mean more aggressive compile-time analysis and moving the
tree-codes away from being close to Scheme.
I noticed a bug in your code for builtin relational operators:
#define REL2(CREL,SREL) \
POP (v0); \
if (SCM_INUMP (v0) && SCM_INUMP (ac)) \
RETURN (SCM_BOOL (SCM_INUM (v0) CREL SCM_INUMP (ac))); \
^^^
|
This should be "SCM_INUM", no? You probably fixed this already.
> % time qscheme < loop.scm
> [...]
> 0.92user 0.00system 0:00.95elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k
> 0inputs+0outputs (195major+162minor)pagefaults 0swaps
>
> Still it's faster than QScheme :)
But note, that you are timing QScheme's startup time as well here.
Maybe it's insignificant.