ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 23 Aug 2011 14:01:45 +0200Timing cached functionshttps://ask.sagemath.org/question/8289/timing-cached-functions/I have defined a recursive function that call itself several times, often asking for the same result that was previously computed. In this setting, defining the function as cached makes perfect sense.
But when i try to timeit, i always get very low timings (i assume the function is computed once and then the cache is called several times, making the average timing very low). I could define the function as non cached, but in that case i can not measure how much i gain by caching the intermediate calls from the function to itself.
Is there some way to say timeit to empty the cache each time the function is run?mmarcoTue, 23 Aug 2011 14:01:45 +0200https://ask.sagemath.org/question/8289/