Issue solved. This was a memory problem. I had used too much memory in the script and MATLAB needed to copy the data from the swap file in order to perform the SpMV.
Slow SpMV (sparse matrix vector product) performance
4 views (last 30 days)
Show older comments
In R2014b, I am performing many SpMV operations using a sparse complex banded matrix with 9 elements per row, grouped in triplets (one triplet is a tridiagonal), and a dense complex vector with about 4 million elements. For some reason, it is extremely slow, taking around 10 seconds to do one on my Core i7 (2.66Ghz quad core) in Win7 x64. I've seen the CUDA libraries for SpMV, but do not have the parallel computing toolbox. Is there anything better to do than just a A*b to try to improve the awful performance?
Edit: I tried this individual command in the MATLAB console and it is about 30x faster (just over 0.3 seconds)! E.g., in my script, I have:
while x
tic
y = A*b;
toc
% other code
end
And in the console I have: tic; y=A*b; toc; And there is a 30x difference between the two. This is consistent and reproducible, but makes no sense to me. If anything, shouldn't the m-file be faster?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Performance and Memory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!