diff options
author | Nathan Harmata <nharmata@google.com> | 2015-08-28 16:59:10 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2015-08-31 19:09:27 +0000 |
commit | 0f4995615fc2dec3185c422b5fc1272bd0c8541a (patch) | |
tree | 30e75a30ac644ec79df94ea9a62310106f8b8621 /src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java | |
parent | 5d83e0f0db359c9133b058034e936bbad5604dd2 (diff) |
In GlobVisitor, use a ConcurrentHashSet and sort the results at the end rather than use a synchronized TreeSet that maintains the result in sorted order.
Consider M adds to the set resulting in N unique elements (so M >= N). The old approach was O(MlogN) and the new approach is O(M + NlogN) and has less lock contention; the time spent holding the lock is O(N) vs O(MlogN) - and actually ought to be small in practice because of the internal striping in CHS.
--
MOS_MIGRATED_REVID=101784791
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java')
0 files changed, 0 insertions, 0 deletions