[plt-scheme] Vector / matrix benchmarks

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Wed Sep 6 06:45:21 EDT 2006

Someone asked about the speed of vector operations in PLT
Scheme.  Below are some benchmarks testing the speed of a
20x20 matrix multiplication using a variety of different
representations.

Results are basically

Galore table >>> array >> srfi-4 vector > vector > c array

An array is a data structure containing a shape vector and
a data vector.

Note that a C blocked matrix multiply is no faster than a
naive implementation, probably because the matrix is so
small.

The results are a bit backward.  When you read, for
example,

  Ensure vectors are faster than tables has a FAILURE

it actually means vectors ARE faster than tables.

HTH,
Noel


mzscheme3m -qev '(exit (load "run-benchmarks.ss"))'
Welcome to MzScheme3m version 352.4, Copyright (c)
2004-2006 PLT Scheme Inc.

benchmarks.ss > Ensure vectors are faster than tables
Ensure vectors are faster than tables has a FAILURE
name: check-faster
location: benchmarks.ss:147:6
params: (#<procedure:table-multiply>
#<procedure:vector-multiply>)
mean1: 1012.8
mean2: 4.200000000000001
std-dev1: 11.849050594878896
std-dev2: 0.42163702135578396
slowdown: 241.14285714285708

benchmarks.ss > Ensure arrays faster than tables
Ensure arrays faster than tables has a FAILURE
name: check-faster
location: benchmarks.ss:151:6
params: (#<procedure:table-multiply>
#<procedure:array-multiply>)
mean1: 1025.2
mean2: 23.3
std-dev1: 6.0332412515993425
std-dev2: 0.674948557710553
slowdown: 44.0

benchmarks.ss > Ensure f32vector faster than vector
Ensure f32vector faster than vector has a FAILURE
name: check-faster
location: benchmarks.ss:155:6
params: (#<procedure:f32-multiply>
#<procedure:vector-multiply>)
mean1: 19.8
mean2: 4.1
std-dev1: 1.6193277068654826
std-dev2: 0.31622776601683794
slowdown: 4.829268292682928

benchmarks.ss > Ensure C multiply faster than vector
Ensure C multiply faster than vector has a FAILURE
name: check-faster
location: benchmarks.ss:159:6
params: (#<procedure:vector-multiply>
#<procedure:c-multiply>)
mean1: 4.0
mean2: 0.9
std-dev1: 0.47140452079103173
std-dev2: 1.1972189997378648
slowdown: 4.444444444444445


Email: noelwelsh <at> yahoo <dot> com   noel <at> untyped <dot> com
AIM: noelhwelsh
Blogs: http://monospaced.blogspot.com/  http://www.untyped.com/untyping/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Posted on the users mailing list.