[html-formfu] very, very slow initially

Carl Franks fireartist at gmail.com
Wed Sep 26 23:35:57 GMT 2007


On 26/09/2007, Josef Chladek <josef.chladek at gmail.com> wrote:
>
> Am 26.09.2007 um 19:14 schrieb Carl Franks:
>
> > On 26/09/2007, Josef Chladek <josef.chladek at gmail.com> wrote:
> >> hello list,
> >>
> >> I move my catalyst-app from my notebook to our servers, and there are
> >> two major problems (it's an apache-server with catalyst as fast-cgi):
> >> the app uses DBIx::Class::HTML::FormFu and my controller uses
> >> Catalyst::Controller::HTML::FormFu as base.
> >>
> >> 1) the first request takes VERY long:
> >>
> >>   .------------------------------------------+-----------.
> >> | Action                                    | Time      |
> >> +-------------------------------------------+-----------+
> >> | /auth/begin                               | 0.006714s |
> >> | /auth/login                               | 9.198848s |
> >> |  -> /auth/show                            | 9.166110s |
> >> | /auth/end                                 | 3.985461s |
> >> |  -> Cat::View::TT->process                | 3.983828s |
> >> '-------------------------------------------+-----------'
> >>
> >> after that request everything is running fast
> >>
> >> .-------------------------------------------+-----------.
> >> | Action                                    | Time      |
> >> +-------------------------------------------+-----------+
> >> | /auth/begin                               | 0.004783s |
> >> | /auth/login                               | 0.049029s |
> >> |  -> /auth/show                            | 0.040471s |
> >> | /auth/end                                 | 0.117099s |
> >> |  -> Cat::View::TT->process                | 0.115839s |
> >> '-------------------------------------------+-----------'
> >>
> >> and I reduced /auth/show to just this
> >>
> >> my $row = $c->model('Frontwave::UserDepot')->find($c->user->obj->id);
> >> $row->fill_formfu_values( $c->stash->{form} );
> >>
> >> and view has just [% form %] in it.
> >>
> >> nothing more done.
> >>
> >> this happens for every fast-cgi child (there are 5), but I can see it
> >> also when I start the app with the dev-server script/myapp_server -
> >> r -
> >> d on the server
> >
> > I suggest you try removing the form, but leave in the DBIx::Class
> > find()
> > I suspect the DBIC class setup is taking up most of that time.
> > I think the latest Class::C3::XS should help.
> >
> > To test FormFu, run:
> >     $ prove -l t/04basic.t
> > t/04basic....ok
> > All tests successful.
> > Files=1, Tests=7,  1 wallclock secs ( 1.06 cusr +  0.05 csys =
> > 1.11 CPU)
> >
> > This test builds and renders 3 separate forms.
> > This will give you a baseline for the basic FormFu functionality.
>
> I am using a lot of DBIC models/schemas, had the C3::XS stuff
> installed before (on my notebook I even use perl 5.9.5 which is
> really fast in loading all the classes). I tried to debug further and
> reduced my show to the following
>
> sub show : Local : FormConfig('auth/show.yml') {
>      my ( $self, $c ) = @_;
> }
>
> without ANY dbic call it takes as long as described above, if I
> remove the
> : Local : FormConfig('auth/show.yml')
> it runs immediately.
> all my other controllers run with no delay after startup, what
> happens when FormConfig is executed? I even removed the
> __PACKAGE__->load_components(qw/HTML::FormFu .../);
> part from my DBICs - no change, still it takes so long...
> my show.yml was reduced to '---', still no change.

Did you remove the DBIC model from your 'lib/MyApp/Model' directory?
Otherwise it might still be getting loaded (can't remember for sure).

How long does t/04basic.t take to run?
Need a baseline to see how fast/slow your server is.

Carl



More information about the HTML-FormFu mailing list