C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

performance paradox when reading matrix from file

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
archondas
Guest





PostPosted: Thu Dec 16, 2004 1:25 pm    Post subject: performance paradox when reading matrix from file Reply with quote



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
the book of Scott Meyers! I wrote a much
simpler code to do the same stuff the code is only one file
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! ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.