about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-04-23 17:09:58 -0700
committerAaron Turon <aturon@mozilla.com>2014-04-24 10:34:13 -0700
commitb536d2bb763d478dbf96c035dbd5b68b5ff639b9 (patch)
tree2819a98060d80a93b68fc455bcb40c824f98d7ae /src/rustllvm/RustWrapper.cpp
parent3157c3e95b3f8d217e4a1e1e7f93939866e74472 (diff)
downloadrust-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