[plt-scheme] r6rs vs module language performance

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Jun 27 12:01:40 EDT 2008

At Fri, 27 Jun 2008 10:36:05 +0200, "Matteo Pradella" wrote:
> On Fri, Jun 27, 2008 at 3:44 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> > At Thu, 26 Jun 2008 06:05:23 -0700 (PDT), Matteo Pradella wrote:
> >> I ported to r6rs a small research prototype I wrote a couple of years
> >> ago (in mzscheme v.3, I think), to "try and feel" the new standard.
> >> Just to waste some time, I tried on the same input file both the "pure
> >> mzscheme" and the r6rs versions: the former took 5.8s on my machine,
> >> while the latter 1m14s. The application core resides in a single r6rs
> >> library, installed (and compiled) through plt-r6rs --install.

It turns out to be an algorithmic difference.

The `scheme/base' version uses `(foldl append ...)', and the R6RS
version uses `(fold-left append ...)'. Those look the same, but it
turns out that `foldl' and `fold-left' pass arguments to the given
procedure in opposite orders. For the R6RS version, you want `(lambda
(x y) (append y x))' instead of just `append'.


Posted on the users mailing list.