dev@javaserverfaces.java.net

RE: Review: Initial Fixes for Issue 125

From: Adam Winer <ADAM.WINER_at_oracle.com>
Date: Sat, 2 Jul 2005 14:17:55 -0600 (MDT)

Jacob,

Great to see some optimizing of this code - getFacetsAndChildren()
is desperately in need of it - but the new getFacetCount()
API's got to be brought over to the EG. Where I'll +1 it.

Also, you could optimize getFacetsAndChildren() further
to deal with the common scenarios of children but no
facets or facets but no children:

  if (getFacetCount() == 0) {
    if (getChildCount() == 0) { return EMPTY_ITERATOR };
    return getChildren().iterator();
  }
  else if (getChildCount() == 0) {
    return getFacets().values().iterator();
  }
  else {
    ... old code ...
  }

...saving a whopping one object allocation, but it does
add up with all the tree walking we do.

And state saving could be further optimized by saving
facets as alternating name/state pairs in the array, instead
of an array of two-element arrays.

-- Adam



-----Original Message-----
From Jacob Hookom <jacob_at_hookom.net>
Sent Sat 7/2/2005 7:50 AM
To dev_at_javaserverfaces.dev.java.net
Subject Review: Initial Fixes for Issue 125

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net