[html-formfu] select element with options attribute slowdown

Carl Franks fireartist at gmail.com
Thu May 10 15:35:24 GMT 2007


On 10/05/07, Tobias Kremer <list at funkreich.de> wrote:

> On one of our systems everything works fine whereas on two other systems
> the following element in our YAML file tremendously slows down form
> rendering.
>
> ---
> elements:
>   - type: select
>     name: test
>     options: [ [ '', 'Month' ], [ 1, 'January' ], [ 2, 'February' ] ... ]
>
> The following error message is thrown repeatedly (about 30 times with
> some noticable delay between them) in the Catalyst error log:
>
> Use of uninitialized value in hash element at
> /Library/Perl/5.8.6/HTML/FormFu/Element/group.pm line 108.
>
> (Yes, this is OS X but I'm having the same problem under Linux on
> a second machine. On the third Linux machine everything runs just fine.
> All machines use the latest SVN trunk for HTML::FormFu and
> Catalyst::C::HTML::FormFu.
>
> We have a couple of those elements in one of our form and the Catalyst
> action that builds the form takes approximately 10 seconds according to the
> Catalyst log (the action does nothing except utilizing C::C::HTML::FormFu's
> FormConfig attribute). The test suite doesn't report any errors.
>
> Any ideas?

I've copied your yaml snippet (and expended the ... up to 12), thrown
it at html-formfu, and not had a problem.
I suggest you investigate whether each machine is using YAML or
YAML::Syck, and which versions thereof.

> Furthermore I'd like to know how HTML::FormFu compares in terms of
> performance with other form engines. I'm somewhat sceptical about how
> a form is assembled with all those TT snippets. Has anyone performed some
> benchmarking yet?

I've not done any proper benchmarking, but running the test suite
against html-widget's shows the same performance.

HTML-Widget test suite:
90 files
625 tests
21.5 user secs average over 3 runs

HTML-FormFu test suite:
161 files
1018 tests
35.5 user sec average over 3 runs

So, formfu has 80% more test files, 60% more tests, and runs them in
60% more time.
I'd say that's even performance, or even an improvement when you
consider the startup cost of the increased number of test files -
something you won't even need to worry about in a persistent
environment.

Carl



More information about the HTML-FormFu mailing list