besides keeping the list overhead down, in cases where there is only one validator (which is an extremely common case), there is no list overhead at all. i think in certain core components (Component and FormComponent) that the extra effort going on in the implementation to reduce session size is really worth it. think about the trillions of
Components and FormComponents being created out there.  in key places like
Component, when you add a boolean to an app with 1M components constructed,
you've just added like 4MB to the session on most chip architectures. that's NOT ONLY
memory, but also BANDWIDTH and SERIALIZATION OVERHEAD in a replicated
environment that hasn't been tuned by hand. that's why i've worked hard to keep the size of such root components down as much as humanly possible. in my profiling, i discovered from the numbers that it really does matter in these handful of places. and as long as we don't have protected member variables, the implementation is all hidden anyway. so no client will ever care. they don't know that when they call setVisible, it's
executing this:

   /**
    * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API.  DO NOT USE IT!
    *
    * @param flag
    *            The flag to test
    * @return True if the flag is set
    */
   protected final boolean getFlag(final short flag)
   {
       return (this.flags & flag) != 0;
   }

yup. we have collapsed about a dozen 4-byte boolean values common to most components into flags stored in a 16 bit short in Component. this will currently save about 40 bytes per Component on most chip architectures. the use of the flags is completely transparent to all
users of the Component class and so nobody even knows about this...

believe it or not, we have done some tuning on wicket already!

      jon

Phil Kulak wrote:

Don't get me wrong, I apreaciate the effort that when into
reimplementing java.util.LinkedList, but I've got to ask... why? It
seems to me like it adds about 100 more lines to the code, calls
validate on each validator O(n^2) times where n is the size of the
list, and makes the ordering of the validators undefined (or just in
reverse, I can't really tell from a cursory glance).


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to