[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "byte compilers, was address@hidden: dynamic loading of native code
From: |
Bill Schottstaedt |
Subject: |
Re: "byte compilers, was address@hidden: dynamic loading of native code modules] |
Date: |
Mon, 15 Apr 2002 06:27:44 -0700 |
With great hesitation and diffidence, on the subject of Guile
compilation, I can offer a simple "accelerator". For context,
in Snd (a sound editor), operations are on hundreds of millions,
occasionally billions of samples; the users are mostly impatient
musicians who view a sound editor as nothing but a necessary
evil; they are not the type that will wait on a multiply. In
95% of the cases in this context, a simple code walker can
ascertain in advance that a given operation (lambda form)
deals with simple data (i.e. floats or ints, not complex or
bignum), and has simple control structures. So, I wrote a
little "byte compiler" of sorts that turns those expressions
into a list of function calls with all the variable/data
addresses precomputed and so on; the evaluator then gets
a pointer to that "parse tree", the current incoming arguments,
and does:
while (!ALL_DONE)
{
curfunc = prog->program[PC++];
(*(curfunc->function))(curfunc->args, ints, dbls);
}
The code runs from 8 to 20 times faster than the Guile evaluator,
still 2 to 3 times slower than the equivalent compiled C code,
but better than 30 times slower! The current version (4 days
work, so still very raw and incomplete) is snd-run.c in the
Snd tarball: ftp://ccrma-ftp.stanford.edu/pub/Lisp/snd-5.tar.gz,
but I'm not really trying to push that code -- more something
along the lines that even a partial acceleration like this
is a real improvement, and easy to write.
- address@hidden: dynamic loading of native code modules], Thien-Thi Nguyen, 2002/04/11
- Re: address@hidden: dynamic loading of native code modules], Neil Jerram, 2002/04/13
- Re: address@hidden: dynamic loading of native code modules], Rob Browning, 2002/04/13
- Re: address@hidden: dynamic loading of native code modules], Neil Jerram, 2002/04/16
- Re: address@hidden: dynamic loading of native code modules], Rob Browning, 2002/04/17
- Re: address@hidden: dynamic loading of native code modules], Thien-Thi Nguyen, 2002/04/20
- Re: address@hidden: dynamic loading of native code modules], Neil Jerram, 2002/04/20
- Re: address@hidden: dynamic loading of native code modules], Marius Vollmer, 2002/04/15
- Re: address@hidden: dynamic loading of native code modules], Neil Jerram, 2002/04/16
- Re: address@hidden: dynamic loading of native code modules], NIIBE Yutaka, 2002/04/16
- Re: address@hidden: dynamic loading of native code modules], Thien-Thi Nguyen, 2002/04/20
- Re: address@hidden: dynamic loading of native code modules], Rob Browning, 2002/04/17