andrew-twisted at puzzling.org
Thu Apr 15 23:22:34 MDT 2004
On Fri, Apr 16, 2004 at 01:05:06AM -0400, jonathan vanasco wrote:
> I'd be interested in your approach to caching. While the bulk of what
> I see this project going is dynamic, certain elements and templates are
> static -- and the constant reading off of disk seems excessive.
Note that reading off the disk itself is often not the problem -- given
enough RAM, the OS will automatically have files cached most of the time.
More likely to be a significant cost is repeated parsing of those
templates... caching the parsed objects in python can help there, or even
storing pickles of stored templates and reading them in with cPickle might
help in some circumstances (or might be worse...).
In short, if your app isn't fast enough, profile to find the bottleneck.
Until then, speculation is mostly futile, and probably wrong. The advantage
of python is you can have a working app much much sooner than with e.g. C,
which gives you much more time to properly profile for bottlenecks and think
of ways to overcome them.
More information about the Twisted-web