[html-formfu] memory / preload changes

Carl Franks fireartist at gmail.com
Wed Sep 5 15:21:03 GMT 2007


I've made a couple of changes to improve memory usage.

I've gotten rid of the dependency on Class::Accessor::Chained::Fast,
which saves about 0.5 MB RAM.

I've also changed Catalyst::Controller::HTML::FormFu to not load
HTML::FormFu::Preload.
This means each hit which loads a previously unused
element/constraint/etc. will have to require() the files.
I think the performance hit isn't noticeable at all, and for the forms
I typically use, I see around a 4 MB RAM saving for each perl
interpreter.
You can, of course, use() HTML::FormFu::Preload anywhere in your code
if you want to still load everything up-front.

Unfortunately, several other things I tried didn't give enough of an
improvement to warrant making the changes (which generally made the
code less clear).

Every unique package (namespace) in a perl program takes up a certain
amount of RAM, and there's very little I can do about that as long as
the elements / constraints / etc. are module-based.

Carl



More information about the HTML-FormFu mailing list