From: Philip S. <ph...@se...> - 2006-04-06 20:55:37
|
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 |