Sometimes I have a cell which takes a while to re-evaluate, but the result is quite small. It would be nice to have an easy way to "cache" some computations by embedding the result in the notebook, and automatically reusing that result on rerun.
IE, instead of
result = expr
I would do
result = memoizedEvaluation[expr]
Any suggestions to how to implement this?
This was motivated by the cell below, result is small, but it takes couple of minutes to evaluate.
graphNamesOrig =
Join @@ Table[GraphData[k], {k, 80, 200}];
graphSpectraOrig =
N[GraphData[#, "LaplacianSpectrum"]] & /@ graphNamesOrig;
Iconize
andPersistentSymbol
? $\endgroup$Once
. $\endgroup$Once[expr,"Local"]
seems to be the thing for this usecase $\endgroup$