For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2005 > faster templates









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author faster templates
Octavian Rasnita

2005-08-25, 7:59 am

Hi,

I am trying to speed up a site that uses mod_perl because it works slowly. I
have done many changes in MySQL queries and they are working now much
faster, but the site is still slow and I think this is because I use
Template-Toolkit.

I like Template-Toolkit very much because it is so complex and it can do
many things, but I saw that in fact I just need a templating system that can
do:

- Is able to loop like "foreach" using arrays or hash references.
- Is able to use conditions (if, elsif, else)
- Is able to create cache.

Do you know which is the fastest templating system which can do these?

Thank you very much.

Teddy


Chris Devers

2005-08-25, 7:59 am

On Thu, 25 Aug 2005, Octavian Rasnita wrote:

> I am trying to speed up a site that uses mod_perl because it works
> slowly. I have done many changes in MySQL queries and they are working
> now much faster, but the site is still slow and I think this is
> because I use Template-Toolkit.


Do you have benchmarks demonstrating this?

Or is this just a hunch?

Never guess; always measure.



--
Chris Devers
Octavian Rasnita

2005-08-25, 9:55 pm

Yes I have measured.

I have put in my program:

my $begin = (times)[0];

....code

my $step1 = (times)[0] - $begin;

....another piece of code

my $step2 = (times)[0] - $begin;

....and so on.

So I have seen how much time takes each piece of code.

After the last step in which tt parses the templates and prints the results,
the time doubles in a single step, so it takes pretty much there.

I also need to make other adjustments in the code to make it faster, but the
most time is taken by tt.

(And I have used PROCESS and not INCLUDE in all the templates, so they
should be working as fast as possible).
(And all the loops in the templates are made based on an already sorted
array, so the templates don't need to make very complicated things).

Thank you.

Teddy


----- Original Message -----
From: "Chris Devers" <cdevers@pobox.com>
To: "Octavian Rasnita" <orasnita@fcc.ro>
Cc: "Perl Beginners List" <beginners@perl.org>
Sent: Thursday, August 25, 2005 15:06 PM
Subject: Re: faster templates


> On Thu, 25 Aug 2005, Octavian Rasnita wrote:
>
>
> Do you have benchmarks demonstrating this?
>
> Or is this just a hunch?
>
> Never guess; always measure.
>
>
>
> --
> Chris Devers


Charles K. Clarkson

2005-08-25, 9:55 pm

Octavian Rasnita <mailto:orasnita@fcc.ro> wrote:

That's not the recommended method of testing template systems. See
http://perl.apache.org/docs/tutoria...comparison.html
for a comparison article. In the performance section IDs a reference to
a comparison available on line http://www.chamas.com/bench/index.html.

BTW, I found this first article as the first result on a
Google search for 'perl template speed comparison'.

HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328

Octavian Rasnita

2005-08-25, 9:55 pm

Thank you. I also found that web page searching with Google and I think I
will try HTML::Template.

Teddy


----- Original Message -----
From: "Charles K. Clarkson" <cclarkson@htcomp.net>
To: "'Perl Beginners List'" <beginners@perl.org>
Sent: Thursday, August 25, 2005 19:28 PM
Subject: RE: faster templates


> Octavian Rasnita <mailto:orasnita@fcc.ro> wrote:
>
> That's not the recommended method of testing template systems. See
> http://perl.apache.org/docs/tutoria...comparison.html
> for a comparison article. In the performance section IDs a reference to
> a comparison available on line http://www.chamas.com/bench/index.html.
>
> BTW, I found this first article as the first result on a
> Google search for 'perl template speed comparison'.
>
> HTH,
>
> Charles K. Clarkson
> --
> Mobile Homes Specialist
> 254 968-8328
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com