Descriptionluci-go/common/dirtools: Tools for walking a directory tree efficiently
This CL adds code to walk directory trees efficiently. It adds three methods of
walking which have the same interface;
* `dirwalk.WalkBasic` - Uses go's builtin walk method
* `dirwalk.WalkParallel` - Uses a worker pool to do the walk on many threads.
* `dirwalk.WalkNoStat` - Uses a custom method which doesn't call stat.
It also adds a bunch of tools for examining the performance of these methods;
* `gendir` - Takes a json description and generates a directory.
* `walkdir` - Walks a directory doing tests.
After comparison on Linux the following results were found;
* dirwalk.WalkNoStat is generally fastest for large number of small files
(such as test1, test4, test5 & test6) and not measurable slower in other
cases.
* dirwalk.WalkParallel is *much* slower in almost all cases (even than the
built in walk)
- In some cases it can deliver the same wall clock time for large increase
in CPU seconds used.
* dirwalk.WalkBasic has very strong performance for the lines of code needed.
* Doing a parallel hash increases performance sometimes and decreases it in
others.
The code is all under a single directory to allow it to be moved into its own go package in the future.
Bugs:
* https://github.com/luci/luci-go/issues/9
* https://crbug.com/598990
BUG=598990
Patch Set 1 #Patch Set 2 : Rebase onto master. #Patch Set 3 : s/dirtools/dirwalk/gc #Patch Set 4 : Moving the test tool locations. #Patch Set 5 : Small updates. #
Total comments: 73
Patch Set 6 : Fixing a bunch of stuff for review. #Patch Set 7 : Rebase onto master. #
Total comments: 1
Patch Set 8 : Refactoring. #Patch Set 9 : Refactoring. #Patch Set 10 : s/NullWalker/BaseWalker/gc #Patch Set 11 : Other changes. #Patch Set 12 : Fixes. #
Total comments: 4
Patch Set 13 : Massive rework #Patch Set 14 : Major rewrite of the code. #
Total comments: 5
Messages
Total messages: 15 (6 generated)
|