Performance and custom tags w/buffers=True
Philip Semanchuk <[email protected]>
| Newsgroups | gmane.comp.python.spyce.general |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
I've been using Spyce in command line mode to generate reports. The
runtime suddenly ballooned and I tracked it down to a custom tag I had
written. Further experimentation showed that the tag behaved very
differently (performance-wise) depending on whether or not I set
buffers=True in the tag definition. I wrote a short page to illustrate
the problem:
[[.taglib from=FooTagLibrary.spy as=foo]]
<html>
<head>
<title>buffers test</title>
</head>
<body>
[[
for i in range(1,1000): {
]]
<p><foo:NullTag>go phillies!</foo:NullTag></p>
[[ } ]]
</body>
</html>
And here's the tag library:
[[.tagcollection ]]
[[.begin name=NullTag buffers=True singleton=False]]
[[\
pass
]]
[[.end]]
The command I use to process this page is:
spyceCmd.py -O test.spy
As you can see, this code will print out the same thing regardless of
the buffers setting in the tag definition. When buffers=True, Spyce
reports "elapsed to finish: 13.6263940334". (This is on a gimpy old
Pentium 3; YMMV.) When buffers=False, Spyce runs about 25x faster
(elapsed to finish: 0.533887863159). The only difference I can see is
that the former spits out a lot (999) of these messages:
cache hit (1113103628) for response in
/usr/local/share/spyce-2.0.3/modules/response.py
Can anyone else (a) repeat these results and, better yet, (b) explain
what's going on?
Thanks
Philip
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642