Re: a faster html::template?

2005-09-10 Thread Perrin Harkins
On Fri, 2005-09-09 at 14:07 -0700, Praveen Ray wrote: > use Time::HiRes qw(gettimeofday tv_interval); Better to use the Benchmark module for this. It looks like you only run each one once. A few hundred iterations would give more stable results. > sub render_tt2 > { > my ($data) = @_; >

Re: a faster html::template?

2005-09-09 Thread Praveen Ray
> Not only that but your XSLT is very badly written. If I > find time I'll > send you a better version. please do. I'm no XSLT guru :( - Praveen __ Click here to donate to the Hurricane Katrina relief effor

Re: a faster html::template?

2005-09-09 Thread Matt Sergeant
On 9 Sep 2005, at 17:07, Praveen Ray wrote: Here is a very very simple script comparing three approaches to build a large html table. I was surprised to see TT2 being the fastest..run it yourself and see. Note that XSLT timings include the time to build XML data string since in real life all dat

Re: a faster html::template?

2005-09-09 Thread Praveen Ray
--- Michael Peters <[EMAIL PROTECTED]> wrote: > > > Praveen Ray wrote: > > Here is a very very simple script comparing three > > approaches to build a large html table. > > would you mind sending this script as an attachment. > Email clients tend > to garble... > > Thanks > Attached. -

Re: a faster html::template?

2005-09-09 Thread Michael Peters
Praveen Ray wrote: > Here is a very very simple script comparing three > approaches to build a large html table. would you mind sending this script as an attachment. Email clients tend to garble... Thanks -- Michael Peters Developer Plus Three, LP

Re: a faster html::template?

2005-09-09 Thread Praveen Ray
Here is a very very simple script comparing three approaches to build a large html table. I was surprised to see TT2 being the fastest..run it yourself and see. Note that XSLT timings include the time to build XML data string since in real life all data comes from Relational Database that must be

Re: a faster html::template?

2005-09-09 Thread Perrin Harkins
On Fri, 2005-09-09 at 14:38 -0400, Matt Sergeant wrote: > Yes I know that's what you're saying. I'm just saying I'd be willing to > bet it's the other way around (even when compared with HT::JIT). I'd wager a pint on this. We could make it a lightning talk at next year's YAPC::NA. - Perrin

Re: a faster html::template?

2005-09-09 Thread Matt Sergeant
On 9 Sep 2005, at 12:12, Perrin Harkins wrote: HTML::Template (or HTML::Template::JIT, to compare C code to C code) has a *very* limited set of logical operations (not Turing complete by any stretch) that operates directly on Perl variables. By comparison, XSP will be making method calls to us

Re: a faster html::template?

2005-09-09 Thread Perrin Harkins
On Fri, 2005-09-09 at 10:22 -0400, Matt Sergeant wrote: > It depends what architecture you use. You have to compare > like-with-like. XSP in AxKit is perl code that executes to build a DOM > tree, not a XML string, so there's no parsing involved - it's just > iterating over a data structure. And

Re: a faster html::template?

2005-09-09 Thread Matt Sergeant
On 8 Sep 2005, at 14:18, Perrin Harkins wrote: Not sure why you say "certainly not". XSLT is very fast and easy to optimise (because it's assignment free) and the C implementations are very quick. Remember that an XSLT transform is executing all its tight loops in C-space, not in perl-space. Y

Re: a faster html::template?

2005-09-09 Thread Foo Ji-Haw
ember 06, 2005 11:39 PM Subject: Re: a faster html::template? > On Fri, 2005-09-02 at 10:53 +0800, Foo Ji-Haw wrote: > > I'm a happy user of HTML::Template on my mp2 setup. But when it comes > > to performance, I notice that to populate a loop of some 1500 records,

Re: a faster html::template?

2005-09-08 Thread Perrin Harkins
On Thu, 2005-09-08 at 09:13 +0300, Octavian Rasnita wrote: > > - Incorrectly configured template caching > > I don't know too much about caching, but I have just configured TT to create > cached templates, so I have used cache. Usually mis-configured caching is the problem. If you call Template-

Re: a faster html::template?

2005-09-08 Thread Perrin Harkins
On Thu, 2005-09-08 at 09:07 -0400, Matt Sergeant wrote: > On 6 Sep 2005, at 11:37, Perrin Harkins wrote: > > > On Mon, 2005-09-05 at 06:42 -0700, Praveen Ray wrote: > >> XSLT transforms are VERY fast > > > > Compared to what? Certainly not compared to HTML::Template. > > Not sure why you say "ce

Re: a faster html::template?

2005-09-08 Thread Jens Gassmann
Hi, When I was using TT, my program was able to serve 1.7 requests per second. (tested with ab program - Apache Bench). After using HTML::Template, the same program, but modified to be able to use HTML::Template, was able to serve over 3 requests per second. After using HTML::Template::Compiled

Re: a faster html::template?

2005-09-08 Thread Octavian Rasnita
From: "Jonathan Vanasco" <[EMAIL PROTECTED]> > You should learn about caching. Tweaking the template caching settings > under any system can vastly improve performance. > I have tried to learn more about caching in TT, but I could find only that I could create cache, and nothing more. No tweaking

Re: a faster html::template?

2005-09-08 Thread Jonathan Vanasco
On Sep 8, 2005, at 2:13 AM, Octavian Rasnita wrote: I don't know too much about caching, but I have just configured TT to create cached templates, so I have used cache. You should learn about caching. Tweaking the template caching settings under any system can vastly improve performance.

Re: a faster html::template?

2005-09-08 Thread Matt Sergeant
On 6 Sep 2005, at 11:37, Perrin Harkins wrote: On Mon, 2005-09-05 at 06:42 -0700, Praveen Ray wrote: XSLT transforms are VERY fast Compared to what? Certainly not compared to HTML::Template. Not sure why you say "certainly not". XSLT is very fast and easy to optimise (because it's assignm

Re: a faster html::template?

2005-09-07 Thread Octavian Rasnita
Hi, From: "Perrin Harkins" <[EMAIL PROTECTED]> > > I suspect you had one of the following problems: > > - Incorrectly configured template caching I don't know too much about caching, but I have just configured TT to create cached templates, so I have used cache. > - Heavy use of method calls in

Re: a faster html::template?

2005-09-07 Thread David Hodgkinson
On 7 Sep 2005, at 21:07, Perrin Harkins wrote: On Wed, 2005-09-07 at 20:41 +0300, Octavian Rasnita wrote: I have used Template-Toolkit, and the time used for parsing those templates used to double the whole time the program needed to run, so the speed of template parsing could be importan

Re: a faster html::template?

2005-09-07 Thread Perrin Harkins
On Wed, 2005-09-07 at 20:41 +0300, Octavian Rasnita wrote: > I have used Template-Toolkit, and the time used for parsing those templates > used to double the whole time the program needed to run, so the speed of > template parsing could be important. I suspect you had one of the following problems

Re: a faster html::template?

2005-09-07 Thread Octavian Rasnita
;mod_perl List" Sent: Wednesday, September 07, 2005 20:00 PM Subject: Re: a faster html::template? > > Just to reiterate - the difference in templating time is very likely > negligible when you factor in your application logic. > > ie: > on my tests a HTML::Template file in

Re: a faster html::template?

2005-09-07 Thread Jonathan Vanasco
Just to reiterate - the difference in templating time is very likely negligible when you factor in your application logic. ie: on my tests a HTML::Template file interpolated in .00x, while a HTML::Template::JIT interpolated in .000y but my application logic takes .025 to work .25x

Re: a faster html::template?

2005-09-07 Thread Perrin Harkins
On Wed, 2005-09-07 at 15:34 +0300, Octavian Rasnita wrote: > HTML::Template::Compiled also has some added features that HTML::Template > and HTML::Template::JIT don't have. > > Unfortunately, HTML::Template::Compiled is not very well finished, so it > doesn't give very helpful errors telling about

Re: a faster html::template?

2005-09-07 Thread Octavian Rasnita
fast in that case. Teddy - Original Message - From: "Foo Ji-Haw" <[EMAIL PROTECTED]> To: "Perrin Harkins" <[EMAIL PROTECTED]>; "Praveen Ray" <[EMAIL PROTECTED]> Cc: Sent: Wednesday, September 07, 2005 12:10 PM Subject: Re: a faster html::

Re: a faster html::template?

2005-09-07 Thread Foo Ji-Haw
ROTECTED]> Cc: Sent: Tuesday, September 06, 2005 11:37 PM Subject: Re: a faster html::template? > On Mon, 2005-09-05 at 06:42 -0700, Praveen Ray wrote: > > XSLT transforms are VERY fast > > Compared to what? Certainly not compared to HTML::Template. > > - Perrin

Re: a faster html::template?

2005-09-06 Thread Perrin Harkins
On Fri, 2005-09-02 at 10:53 +0800, Foo Ji-Haw wrote: > I'm a happy user of HTML::Template on my mp2 setup. But when it comes > to performance, I notice that to populate a loop of some 1500 records, > the system takes 2-3 seconds on my P4 2GHz machine. Populating the loop happens before running HTM

Re: a faster html::template?

2005-09-06 Thread Perrin Harkins
On Mon, 2005-09-05 at 06:42 -0700, Praveen Ray wrote: > XSLT transforms are VERY fast Compared to what? Certainly not compared to HTML::Template. - Perrin

Re: a faster html::template?

2005-09-05 Thread Praveen Ray
> > 1500 record? don't do it: page or use AJAX. > > Been there. It was horrible. > I'd second that..1500 seems too high for human consumption. Anyway, for such large datasets you can try going XML/XSLT way. XSLT transforms are VERY fast (use LibXSLT) - downside being XSL is a super verbose and

Re: a faster html::template?

2005-09-04 Thread Foo Ji-Haw
. Running it by a cache (cache=>1) seems to make the NEXT interation faster though. But the first one is always slow. - Original Message - From: "David Hodgkinson" <[EMAIL PROTECTED]> To: "Foo Ji-Haw" <[EMAIL PROTECTED]> Cc: Sent: Monday, September 05,

Re: a faster html::template?

2005-09-04 Thread David Hodgkinson
On 2 Sep 2005, at 03:53, Foo Ji-Haw wrote: Hi all, I'm a happy user of HTML::Template on my mp2 setup. But when it comes to performance, I notice that to populate a loop of some 1500 records, the system takes 2-3 seconds on my P4 2GHz machine. I think that's way too long, especially on a

a faster html::template?

2005-09-04 Thread Foo Ji-Haw
Hi all,   I'm a happy user of HTML::Template on my mp2 setup. But when it comes to performance, I notice that to populate a loop of some 1500 records, the system takes 2-3 seconds on my P4 2GHz machine. I think that's way too long, especially on a development machine.   I tried to load the te