[html-formfu] very, very slow initially

Carl Franks fireartist at gmail.com
Thu Sep 27 08:59:08 GMT 2007

On 27/09/2007, Josef Chladek <josef.chladek at gmail.com> wrote:
> Am 27.09.2007 um 08:17 schrieb Carl Franks:
> >>
> >> sorry, here are my results:
> >>
> >> prove -l t/04basic.t
> >> t/04basic....ok
> >> All tests successful.
> >> Files=1, Tests=7,  1 wallclock secs ( 0.54 cusr +  0.04 csys =  0.58
> >> CPU)
> >>
> >> server is pretty fast normally...
> >> removing all my DBIC models makes it fast again. but even if I use
> >> formfu without fill_formfu_values, why does it matter that I have a
> >> lot of DBIC models? hmmm...
> >
> > Catalyst automatically loads all the packages it finds under
> > MyApp/Controller, MyApp/Model and MyApp/View - at startup, not on
> > demand - so it knows what's available.
> > This is definitely a DBIC issue - not a FormFu issue.
> >
> > Search the DBIC list archives for a thread with the title "Startup
> > speed".
> > With the suggestions there, the OP managed to get his startup time
> > from 19s down to 2s.
> thanks carl, but startup-speed is one thing (and I got used to that).
> but normally AFTER the startup everything is running fast. not so
> when I have a formfu-controller with LoadConfig, it seems, that with
> the first request (and that is after startup) something Class/DBIC
> magic is happening, after this first request the app behaves normal.
> so my guess is, that some reinitializing/call to setup happens, that
> maybe reloads models, caused by formfu/controller-formfu. because any
> other method in my controllers does not have that delay...
> I'm trying to put some debug/timing code in formfu pms to find out more

Are you using SchemaLoader, or an older version of DBIC that loads its
column_info from the database?

Try putting "use HTML::FormFu::Preload" into your root/base controller.
This will ensure that all FormFu classes are loaded at startup time.
Then see how long the 1st request takes.

Then try removing FormFu, but keeping the DBIC calls, so do your
    my $row = $c->model('Frontwave::UserDepot')->find($c->user->obj->id);
Then for each fieldname that was in your form, manually do each method
call that would normally take place in
    $row->fill_formfu_values( $c->stash->{form} );
This will show your the DBIC-only time.

I'd also use Devel::Profiler to narrow things down.


More information about the HTML-FormFu mailing list