lib.c (config_set_var_n): Return a pointer even if we don't change the var.
[runlisp] / bench / massage-benchmarks
CommitLineData
e29834b8
MW
1#! /usr/bin/perl
2
3use autodie;
4
5my %LISP =
6 ("sbcl" => "SBCL",
7 "ccl" => "Clozure CL",
8 "ecl" => "ECL",
9 "clisp" => "GNU CLisp",
10 "cmucl" => "CMU CL",
11 "abcl" => "ABCL");
12my %LABEL =
13 ("perl" => "Perl",
14 "python" => "Python",
15 "c.tcc" => "Tiny C",
16 "c.gcc" => "GCC",
17 "shell.dash" => "dash",
18 "shell.bash" => "GNU Bash",
19 "shell.zsh" => "Z Shell");
20
21for my $l (keys %LISP) { $LABEL{"runlisp.$l"} = $LISP{$l}; }
22
23{
24 my %d;
25
26 sub timing ($) {
27 my ($f) = @_;
28 return $d{$f} if exists $d{$f};
29 open my $fh, "<", "$f.bench";
30 (my $data = readline $fh) =~ s/^.* elapsed = ([0-9.]+)s.*$/$1/;
31 return $d{$f} = $data;
32 }
33}
34
35print <<EOF;
36#> lisp
37"Lisp system" "\\\\texttt{cl-launch}" "\\\\texttt{runlisp} (vanilla image)" "\\\\texttt{runlisp} (custom image)"
38EOF
39for my $l (sort keys %LISP) {
40 printf "\"%s\" %.4f %.4f %.4f\n",
41 $LISP{$l},
42 timing("cl-launch.$l"),
43 timing("runlisp-noimage.$l"),
44 timing("runlisp.$l");
45}
46print "\n\n";
47
48print <<EOF;
49#> interp
50EOF
51for my $i
52 ("runlisp.ccl", "runlisp.clisp", "runlisp.cmucl", "runlisp.sbcl",
53 "perl", "python",
54 "shell.dash", "shell.bash", "shell.zsh",
55 "c.tcc", "c.gcc")
56 { printf "\"%s\" %.4f\n", $LABEL{$i}, timing $i; }