Skip Menu |

This queue is for tickets about the Dancer-Plugin-DataFu CPAN distribution.

Report information
The Basics
Id: 71690
Status: new
Priority: 0/
Queue: Dancer-Plugin-DataFu

People
Owner: Nobody in particular
Requestors: dave [...] seleno.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Optimization for D::P::DataFu::Grid
Date: Fri, 14 Oct 2011 17:09:26 -0700
To: bug-Dancer-Plugin-DataFu [...] rt.cpan.org
From: David Seleno <dave [...] seleno.net>
in sub render, move the Template object creation out of the inner subroutine to increase performance. This way you only create one Template object per call to render, rather than one for every sub-component and cell of the rendered grid. For most grid renders I saw my execution times decrease by 50-90%. my $template = Template->new( INTERPOLATE => 1, EVAL_PERL => 1, ABSOLUTE => 1, ANYCASE => 1 ); my $tempro = sub { my ($file, $args) = @_; # moved Template->new out my $data = undef; $template->process( $file, $args, \$data ) || die $template->error; return $data; };