It is so slow!


As a rule of thumb, the time reported as ‘yalmiptime’ in the output diagnostic should be around fractions of a second for small problems, and typically a fraction of the actual solution time for larger problems. If this is not the case, you probably have a problem with your installation.

As another rule of thumb, yalmiptest(sdpsettings(‘verbose’,0,’solver’,’sedumi’)) takes 2-5 seconds (including initial search for solvers) on my PC machines (2GHz and 3GHz).

Are you running over a network? This can be extremely detrimental for general performance in YALMIP. On some networked Linux version, YALMIP runs 10-100 times slower!

Another way to tackle strange performance issues is to set the field ‘cachesolvers’ in sdpsettings to 1. (One possible cause for poor performance of YALMIP is due to slow network functionality, making the command exist , which is used in optimize when detecting solvers, very slow.) This option can however cause strange behavior if you add or delete solvers, so it should only be used in very rare cases where you know that you have a ridiculously slow network access to your files.

Do you have a poor sparse matrix library in your installation? Some distributions seem to have extremely poor performance for sparse matrices (observed on Linux), which is used a lot in YALMIP. One way to test this is to run the script below. If the displayed result is substantially larger than 20, you have problems (and I have no idea how you can resolve this…)

d = sprandn(1e5,1,0.5);
tic;for i= 1:1000;d([2000:3000]);end;t1 = toc;
d = d';
tic;for i= 1:1000;d([2000:3000]);end;t2 = toc;t1/t2

Leave a Comment