[html-formfu] [patch] Change eval tests to use ref for big
speed up in _Group.pm
Steve Nolte
steve at redanvil.net
Thu Dec 3 14:32:27 GMT 2009
> 2009/12/2 Steve Nolte <steve at redanvil.net>:
> > I noticed a big slow down when dealing with group-type fields that
> have a lot of options. Tracked it down to the H::FF::E::_Group
> _parse_option() which was using eval's for testing if the item was a
> hash or array reference. Switched it to just test with ref() and got a
> major speed up, about 1.5 to 2 seconds for some forms.
>
> Hi Steve,
>
> I've gone through the entire HTML-FormFu source, changing all similar
> uses of eval().
> I went with Ronald's sugestion of Scalar::Util::reftype() - but thanks
> for the initial patch!
>
> Cheers,
> Carl
That's fantastic, thanks Carl! Great timing, I was just about to suggest
doing that same thing. This should really speed up larger forms with lots
of options.
-Steve
More information about the HTML-FormFu
mailing list