[Petal] [Patch]Problem with last patch

Fergal Daly fergal at esatclear.ie
Sun Jul 20 22:36:14 BST 2003


The last patch for the tal-style repeat counter had a problem with nested 
loops. This explains a large part of the surprising 5x speedup - if it's too 
good to be true, it's usually not true.

This new patch fixes that. However for some reason neither patch plays well 
with Petal's $hash->get() method which does some sort of caching - this 
explains another big part of the speed up.

It is however safe to use if you're using Petal::CodePerl as this does no 
caching of Petales expressions.

The speedup is 50% for my dictionary template, which does a lot of looping. 
It's still not too bad I suppose and it means that for my dictionary program 
Petal is now about 30% faster than Template::Toolkit

        tt:  5 wallclock secs ( 5.15 usr +  0.02 sys =  5.17 CPU) @ 18.76/s 
(n=97)
 petalloop:  6 wallclock secs ( 4.44 usr  0.58 sys +  0.16 cusr  0.40 csys =  
5.58 CPU) @ 24.90/s (n=125)

F
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loop2.patch
Type: text/x-diff
Size: 12505 bytes
Desc: not available
Url : http://www.email-lists.org/pipermail/petal/attachments/20030720/f96ad6dd/loop2.bin


More information about the Petal mailing list