|
Boost : |
Subject: Re: [boost] performance of a linear algebra/matrix library
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-05-06 13:24:22
----- Original Message -----
From: "DE" <satan66613_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, May 06, 2010 7:02 PM
Subject: [boost] performance of a linear algebra/matrix library
>
> hi all
>
> i work on a linear algebra library with an intent to propose it for
> inclusion into boost collection of libs
>
> so my question is: how fast such a lib should be to make everybody
> happy?
>
> i found that to increase the performance of a generic linear algebra
> library one must complicate the implementation to a very high degree
> (though this statement should be obvious to everyone)
>
> i struggled with poor performance of matrix multiplication and finally
> identified the bottleneck
>
> i improved the implementation (seriosly complicating it, i'm afraid i
> will forget how it works in a month) and now it performs some 33%
> slower than C code for virtually any size of matrix
<snip>
> the C++ code is just
>
> matrix<type> m(n, n), m1(n, n), m2(n, n);
> //filling 'm1' and 'm2'
> m.assign(m1, m2);
>
> more detailed results:
> 'n' is the dimensions of matrices, 'ratio' is runtime of C++ code
> divided by runtime of C code (time_cpp/time_c)
>
> n | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048
> ratio | 1,77 | 1,57 | 1,34 | 1,12 | 1,05 | 1,12 | 1,32 | 1,33 | 1,23 | 1,23 | 1,23
>
> as you can see starting with 8 by 8 matices C++ code is roughly 33%
> slower than C code
>
> is that enough to make you (the reader) happy?
Why is it slower? or better where do you spent more time than doing it in C?
BTW, what m.assign(m1,m2) does (I have not read the C code)?
What about Boost.LA?
Best,
Vicente
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk