MATLAB: Speed up run time of mldivide function.

MATLABmldivide

Hi,
I am calling mldivide function about 10^7 times:
my syntax looks this way:
C=mldivide(A,B);
where both A,B are sparse matrices. size(A)=2^10*2^10 and size(B)=(1×2^10) (Assume that my matrix A has ~2^12 non zero data points ~95% of them close to center diagonal.A is a lower traingular matrix)
After using the profile command ,when i run the code, i found it takes 60-70% of total time(~2000 secs) in that particular line.(My computer specs are i5, 8gb ram, matlab 2018b)
can i make mldivide compute any faster? (assume that I can only use sparse matrices, and assume that i want to run it on my computer.).
Unfortunately, GPU computing of mldivide using sparse matrice does not seem to work so well. If you can, please comment on using 'GPU computing with (mldivide + sparse matrices)' as well..

Best Answer

If you're solving the system A*x = b with the same A every time (or a small number of different A matrices many times each) try creating a decomposition and reusing that decomposition each time.