[html-formfu] Performance

Tobias Kremer list at funkreich.de
Fri Jun 22 15:35:30 GMT 2007


> Hmm, are you using the compiled C, or pure-perl TT stash?
> Is TT caching on?

XS Stash with TT caching on.

> Is that 50-60% of just the action subroutine that's being hit, or of
> the entire catalyst process? What else is the action doing?

Not much else. Here's the entire action:

<!--snip-->

$c->stash->{ 'template' } = 'formfu.tt';
my $form = HTML::FormFu->new( {
  render_class_args => { INCLUDE_PATH => MyApp->path_to( 'root', 'formfu' ) }
} );
$form->load_config_file( MyApp->path_to( 'root', 'forms', 'formfu.yml' ) );
$form->process( $c->request );

my $st = [gettimeofday];
my $bla = "$form";
my $et = [gettimeofday];
$c->log->debug( 'form stringify: ', tv_interval( $st, $et ) * 1000 );

$st = [gettimeofday];
$form->render;
$et = [gettimeofday];
$c->log->debug( 'form render: ', tv_interval( $st, $et ) * 1000 );

$c->stash->{ 'form' } = $form;

<!--snip-->

> It would be worth comparing the times for stringifying "$form" and
> doing $form->render.
> That should help figure out whether it's the FormFu internals, or TT.

Here's the abbreviated Catalyst debug output after the first and second
request:

[info] *** Request 1 (0.167/s) ***
[debug] form stringify: 117.672
[debug] form render: 7.74
[info] Request took 0.226142s (4.422/s)
.------------------------------------------+-----------.
| Action                                   | Time      |
+------------------------------------------+-----------+
| /manual                                  | 0.139479s |
| /end                                     | 0.070367s |
|  -> FormFuBenchmark::View::TT->process   | 0.068465s |
'------------------------------------------+-----------'

[info] *** Request 2 (0.222/s) ***
[debug] form stringify: 69.614
[debug] form render: 7.683
[info] Request took 0.161336s (6.198/s)
.------------------------------------------+-----------.
| Action                                   | Time      |
+------------------------------------------+-----------+
| /manual                                  | 0.087157s |
| /end                                     | 0.066578s |
|  -> FormFuBenchmark::View::TT->process   | 0.064919s |
'------------------------------------------+-----------'

> btw, what are you using to get the requests-per-second figure?

Catalyst Debug output (see above).

--Tobias



More information about the HTML-FormFu mailing list