# Sudden increase in computation time for similar computations

I'm doing some numerical simulations on a physical system. In the most simplest form I have now the following:

$HistoryLength=0; {evals,evecs}=Eigensystem[H]; Export["results v0.jpg",x]; {evals,evecs}=Eigensystem[H+V1]; Export["results v1.jpg",x]; {evals,evecs}=Eigensystem[H+V2]; Export["results v2.jpg",x]; ... {evals,evecs}=Eigensystem[H+V20]; Export["results v20.jpg",x];  Where H and V0-V20 are predefined SparseArrays with dimensions 6480 x 6480. Using the eigenvalues and eigenvectors I get from Eigensystem I make some plots of different things I want to know about. All the plots I place in a table of size 3 x 50 and Rasterize the whole thing. This whole process I absorbed into a function I called x. On my computer computing Eigensystem takes about 40 min and exporting the results about 20 min. The strange thing now is that if I check the timestamps on my figures I see that the computation time increases quite a bit for each line. It took about an hour to get the first result, and each next result takes more and more time. Before I closed the kernel I had 4 figures, where it took over 4 hours to produce the last one. Before I added $HistoryLength = 0 the increase in computation time was even more severe.

After I close the kernel and start it again I can just continue the evaluation where it stopped before and the first figure will be produced in about an hour, but the next ones will take again longer and longer to be produced.

First of all I would like to know why the increase in computation time, but also how I can fix it. Right now I have no idea what Mathematica does this. At first I thought it was a memory thing, which is why I added the \$HistoryLength = 0. Though it helps a bit it doesn't fix the problem.

-
more code is needed. When you reverse the Eigensystems is the timing also reversed? –  user21 May 28 at 21:00
Also could try ClearSystemCache[] in case some cached results are taking up needed RAM. –  Daniel Lichtblau May 28 at 21:36