RE: Review: Initial Fixes for Issue 125

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


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 <>
Sent Sat 7/2/2005 7:50 AM
Subject Review: Initial Fixes for Issue 125

To unsubscribe, e-mail:
For additional commands, e-mail: