Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > performance paradox when reading matrix from file
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 30th May 22:33
archondas
External User
 
Posts: 1
Default performance paradox when reading matrix from file



Dear C++ experts,
I am wondering if there is anyone who can explain the following paradox! I
have a sparse-matrix in CSR format
stored in binary file. I create that sparse-matrix using
a specific routine and I can either store it in a binary
file or use it directly. I go both ways. So, I want to
bencmark 100 sparse-matrix vector multiplications. My platform is SuSE
9.2(kernel default) with g++-3.4.3
compiled from source, and the program which
performs the multiplication is compiled with:

-O3 -funroll-all-loops -fomit-frame-pointer -march=pentium4

If I read the matrix from the binary file and then perform
the multiplication the whole thing needs 3.8 seconds to
finish! If I construct the matrix directly in memory and
then use it for performing the multiplications the whole
thing finishes in 5.9 seconds! This is a huge difference
observed with compiler gcc-3.4.3. The code uses reference counting from


and it also reads the matrix from a binary file! Its
performance though is also 5.9 seconds! So reading the
matrix from a file with reference counting code needs 3.8 seconds while
the much simpler code which also reads the matrix from a file needs 5.9
seconds. Using the reference
counting code but creating the matrix directly in memory
instead reading the matrix from the binary file needs also
5.9 seconds!

In FreeBSD 4.10 and 5.3 Release though, all the above
approaches need 5.9 seconds!

What is going on?

Whoever want to dwelve into this and explain the mystery
let me know and I can forward the code!

Best Wishes!
Drosos.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
  Reply With Quote


 


Reply


Thread Tools
Display Modes




666