by warfangle · 17y ago · 0 comments
For six form fields, it took 500ms (according to firebug's profiler) to initialize on a 2.4ghz core 2 duo. Granted, I'm using Firefox 3, and not 3.5.
I'm assuming that this scales linearly with each form element that this trick is applied to, in which case a page with 12 form elements would take 1 full second to initialize the javascript.
I'd stay away from this if you have more than two form elements using it. It's bound to slow down the user experience unbearably.
On the examples page, I profiled the five InFieldLabel calls at a total of just over 28ms. Firefox 3.5, 2.2 Ghz Core Duo. Its not the field calls that take 500ms, even in Firefox 3.0.
What I profiled as taking that long was the jQuery init functions, which I assumed were required (and called by) the plugin.
Then again, I'm not as familiar with jQuery as I once was. All I know is that I don't like method chaining (impossible to set mid-line breakpoints and try/catch blocks), the extended element (if it's anything like prototype) is extremely heavy and not needed a majority of the time, and if you use massive amounts of it (see: slashdot) the user experience is deleteriously affected.
And really, 500ms initialization (even if it's jQuery and not the plugin initializing, that's a long time) for a user-experience-worsening toy like this.. I don't see the point.