[plt-scheme] Performance Targets for MzScheme
At one time we had some performance statistics that
showed MzScheme was pretty fast compared to other
Scheme implementations. This was done pre 200-series,
so things have almost certainly changed.
For fun, I started playing with some existing
benchmarks found on the internet to see how MzScheme
stacks up to other similar systems.
The first test I ported does not show MzScheme to be a
great performer. In this test, the idea is to read in
a fairly large file (15 Megs) and split each line into
tokens (by spaces):
(require (lib "13.ss" "srfi")
(lib "42.ss" "srfi"))
(define (file-line-split-test)
(let ((fp (open-input-file "testfile.dat")))
(do-ec
(:port line fp read-line)
;Split the line up
(string-tokenize line))))
> (load "all_test.scm")
> (time (file-line-split-test))
cpu time: 39607 real time: 40209 gc time: 7025
>
Python:
def file_line_split_test(NESTED):
fp = open("testfile.dat")
for a_line in fp.readlines():
line_parts = string.split(a_line)
C:\Fulgham\Projects\schematics\performance>python
all_test.py
starting
file_line_split_test(1) elapsed: 1.78199982643 seconds
Perl:
sub file_line_split_test {
my ($INDEX) = @_;
my $line;
open(FILE,"testfile.dat");
while (<FILE>) {
@line_parts = split(" ");
}
};
C:\Fulgham\Projects\schematics\performance>perl
all_test.pl
file_line_split_test elapsed 2.42350912094116
Thus, the gauntlet has been thrown. How can we drop
our speed by an order of magnitude to compete with
these other scripting languages?!? :-)
-Brent