From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bill Schottstaedt Newsgroups: gmane.lisp.guile.user Subject: Re: "byte compilers, was [d.love@dl.ac.uk: dynamic loading of native code modules] Date: Mon, 15 Apr 2002 06:27:44 -0700 Sender: guile-user-admin@gnu.org Message-ID: <200204151327.GAA21735@cmn14.stanford.edu> References: <874rifqeo8.fsf@raven.i.defaultvalue.org> <87lmbpiocf.fsf@raven.i.defaultvalue.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 (NeXT Mail 3.3 v148.2.1) Content-Type: text/plain X-Trace: main.gmane.org 1018878279 19171 127.0.0.1 (15 Apr 2002 13:44:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 15 Apr 2002 13:44:39 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16x6md-0004z6-00 for ; Mon, 15 Apr 2002 15:44:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16x6l3-0002ew-00; Mon, 15 Apr 2002 09:43:01 -0400 Original-Received: from cm-mail.stanford.edu ([171.64.197.135]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16x6WK-000879-00 for ; Mon, 15 Apr 2002 09:27:48 -0400 Original-Received: from cmn14.stanford.edu (cmn14.stanford.edu [171.64.197.163]) by cm-mail.stanford.edu (8.11.6/8.11.6) with ESMTP id g3FDRlA01182 for ; Mon, 15 Apr 2002 06:27:47 -0700 Original-Received: (from bil@localhost) by cmn14.stanford.edu (8.9.3/8.9.3) id GAA21735 for guile-user@gnu.org; Mon, 15 Apr 2002 06:27:46 -0700 (PDT) In-Reply-To: <87lmbpiocf.fsf@raven.i.defaultvalue.org> X-Nextstep-Mailer: Mail 3.3 [m68k] (Enhance 2.2p2) Original-Received: by NeXT.Mailer (1.148.2.1) Original-To: guile-user@gnu.org Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:176 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:176 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. _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user