diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-04-23 17:09:58 -0700 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-04-24 10:34:13 -0700 |
| commit | b536d2bb763d478dbf96c035dbd5b68b5ff639b9 (patch) | |
| tree | 2819a98060d80a93b68fc455bcb40c824f98d7ae /src/rustllvm/RustWrapper.cpp | |
| parent | 3157c3e95b3f8d217e4a1e1e7f93939866e74472 (diff) | |
| download | rust-b536d2bb763d478dbf96c035dbd5b68b5ff639b9.tar.gz rust-b536d2bb763d478dbf96c035dbd5b68b5ff639b9.zip | |
fix O(n^2) perf bug for std::io::fs::walk_dir
The `walk_dir` iterator was simulating a queue using a vector (in particular, using `shift`), leading to O(n^2) performance. Since the order was not well-specified (see issue #13411), the simplest fix is to use the vector as a stack (and thus yield a depth-first traversal). This patch does exactly that. It leaves the order as originally specified -- "some top-down order" -- and adds a test to ensure a top-down traversal. Note that the underlying `readdir` function does not specify any particular order, nor does the system call it uses. Closes #13411.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
