apache/curator — pull request #46 by leons727 (2014-10-03 21:15:35+00:00)
Title: Performance fix in processChildren()

Current implementation may lead to a large number of calls to java.util.ArrayList.contains() with a large list, when syncing a large number of path children, as evident from this stack trace:

```
"main-EventThread" daemon prio=10 tid=0x00007fd089593800 nid=0x6fbf runnable [0x00007fd0eb3a1000]
java.lang.Thread.State: RUNNABLE
at java.util.ArrayList.indexOf(ArrayList.java:298)
at java.util.ArrayList.contains(ArrayList.java:281)
at java.util.AbstractSet.removeAll(AbstractSet.java:176)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.processChildren(PathChildrenCache.java:655)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.access$200(PathChildrenCache.java:68)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$4.processResult(PathChildrenCache.java:490)
at org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(CuratorFrameworkImpl.java:715)
at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:502)
at org.apache.curator.framework.imps.GetChildrenBuilderImpl$2.processResult(GetChildrenBuilderImpl.java:166)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:587)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495)
```