<html>
<body>
Caching for speed is a concept brand new to me, and there's a remarkable
example in a thread on the python-list. I thought some readers of this
list might find it instructive. However, to run the scripts you'll need
mpmath.
&lt;<a href="http://code.google.com/p/mpmath/" eudora="autourl">
http://code.google.com/p/mpmath/</a>&gt;<br><br>
Begin by jumping in toward the end of the thread:<br><br>
&lt;<a href="http://mail.python.org/pipermail/python-list/2007-November/466662.html" eudora="autourl">
http://mail.python.org/pipermail/python-list/2007-November/466662.html</a>
&gt;<br><br>
Note Fredrik Johansson's function f() that he suggests could greatly
speed up my demo of the amazing Chudnovsky algorithm for pi, at
&lt;<a href="http://python.pastebin.com/f4410f3dc" eudora="autourl">
http://python.pastebin.com/f4410f3dc</a>&gt;.<br><br>
I didn't understand what to do with it, so I ask,
&lt;<a href="http://mail.python.org/pipermail/python-list/2007-November/467148.html" eudora="autourl">
http://mail.python.org/pipermail/python-list/2007-November/467148.html</a>
&gt;. But see the revision I did make,
&lt;<a href="http://py77.python.pastebin.com/f48e4151c" eudora="autourl">
http://py77.python.pastebin.com/f48e4151c</a>&gt;<br><br>
And his revision of that,
&lt;<a href="http://py77.python.pastebin.com/m6b2b34b7" eudora="autourl">
http://py77.python.pastebin.com/m6b2b34b7</a>&gt;.<br><br>
As for the speed-up on my computer due to the caching done by f():
&lt;<a href="http://py77.python.pastebin.com/f48e4151c" eudora="autourl">
http://py77.python.pastebin.com/f48e4151c</a>&gt; takes 151 secs for 2000
digits of pi;
&lt;<a href="http://py77.python.pastebin.com/m6b2b34b7" eudora="autourl">
http://py77.python.pastebin.com/m6b2b34b7</a>&gt; takes 0.4
secs!<br><br>
Dick Moores<br>
</body>
</html>