[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Crunch performance (really strange)

From: Jeronimo Pellegrini
Subject: [Chicken-users] Crunch performance (really strange)
Date: Thu, 5 Nov 2009 11:11:20 -0200
User-agent: Mutt/1.5.20 (2009-06-14)


So, I have been learning more about crunch, and I
decided to run some tests, and the resuts are, well,
very srtange.

I have ran four different versions of the "naive multiply
matrices" algorithm:

1) mm-vectorvector: implements the matrix as a vector of

2) mm-singlevector: implements the matrix as a single
   long vector, and calculates the index when needed

3) mm-vectorvector-crunch: like #1, but using crunch

4) mm-singlevector-crunch: like #2, but using crunch

These are modifications that I did in the code that was
included in the git repo with the crunch egg.

The results are puzzling:

cpp                     19.41 seconds
mm-vectorvector         267.164
mm-vectorvector-crunch  882.523
mm-singlevector         911.945
mm-singlevector-crunch  886.307

(On an AMD64, 1GHz running Linux 2.6.30)

So the vector-of-vectors approach runs faster than
all other Scheme versions (!)

I have uploaded all files here:

To run the tests,

$ make
$ echo "1" | ./cpp
$ ./mm-vectorvector        1 1000x1000x.mat 1000x1000y.mat
$ ./mm-singlevector        1 1000x1000x.mat 1000x1000y.mat
$ ./mm-vectorvector-crunch 1 1000x1000x.mat 1000x1000y.mat
$ ./mm-singlevector-crunch 1 1000x1000x.mat 1000x1000y.mat

What could have happened?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]