Re: QuickForm replacement within

From: Date: Wed, 18 Oct 2006 19:19:32 +0000
Subject: Re: QuickForm replacement within
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-25532@lists.php.net to get a copy of this message
Hi, Seth Price wrote:
It's also fast, in an email last week I did a quick-and-dirty profile of my code. The total render time using QuickForm was in the ~0.90 second range. Render time for a new identical form, with added rules and JavaScript validation is ~0.52 seconds. Without any form being used, the page takes ~0.38 secs to render. The API used is virtually identical.
This data is completely useless, as was already said. You are measuring total page generation times (including file loading and PHP parsing stage). People actually interested in performance use bytecode caches.
This isn't intended as any sort of insult to QuickForm developers. I got some things coded that have been in my head for a while, and I kept a close tabs on the QuickForm way of doing things. It's more of a challenge for them to make QuickForm2 at least this powerful.
"At least this powerful" is a nice joke indeed.
One thing that I particularly like is a customizable rule that I've created (QF2 should have something like this IMHO). Here is it's usage in the form that I made. If the text input is blank *and* a value -2 is selected in the pull down menu, throw an error:
        $newNameElm->addRule(new Form_Rule_Boolean('%s == "" && %s == -2',
                    'If you are creating a new area, you must fill in it\'s name.',
                    $newNameElm, $areaElm));
It's a completely free form boolean statement, with an arbitrary number of elements used. It automatically uses the boolean statement to generate code for both client side and server side validation. This example really doesn't show off its power, but I'll let you use your imagination.
Yep, it is exactly a thing we try to avoid in QF2 development: a quick and dirty hack. Seriously, we aren't writing QF2 slowly because we can't churn out code fast enough. We are just spending quite a bit of time on stuff you consider uninteresting: API documentation, full unit tests, some actual planning.

« previous php.pear.general (#25532) next »