in reply to Re^5: developing a template system
in thread developing a template system

It looks like your loop context vars are off by 1
yep, noticed that, that should be an easy fix.

About speed - I tested with a larger template by just repeating the same template code a couple of times. The larger the template, the faster was H::T::JIT.
With my example template, they reach about the same speed here. So for big templates H::T::JIT definitely seems to be a lot faster.

If I turn off case_sensitive, I'm only about 2.5 times faster than H::T instead of 5, but on the other hand turning on case_sensitive in H::T doesn't result in a speed gain.

Replies are listed 'Best First'.
Re^7: developing a template system
by perrin (Chancellor) on Aug 22, 2005 at 13:18 UTC
    My results are a bit different. When I turn off case-sensitivity, JIT immediately becomes 20% faster than Compiled. When I increase the size of the template, JIT slows down but Compiled is almost unaffected. At 4 times the original size, JIT slows down to the point where Compiled is twice as fast as JIT.

    FYI, my system is Fedora Core 3 with Perl 5.8.5.

      interesting - i guess i'll extend the benchmark script a bit so that it runs for different template sizes. The results seem to differ very much. How are you testing?

      I'm on Linux 2.6.10-5-amd64-xeon, perl 5.8.4.

        I am just running it through 5000 iterations. I did comment out the "new" part of the benchmark, since I don't find that bit interesting. I am just looking at the "output" times.