about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-13 03:35:15 +0000
committerbors <bors@rust-lang.org>2018-12-13 03:35:15 +0000
commitced7cc5c6523ff478599ed9188df37e91fd96c68 (patch)
treedccfd0a0b4e2b303740566fd08e0bf6fc8c4db35 /src/rustllvm/RustWrapper.cpp
parent2f35a1016b0c0cc1132c19875dcd88d7b2825eae (diff)
parent209240dc267075d69eb8d1dba23be2a8c80c6427 (diff)
downloadrust-ced7cc5c6523ff478599ed9188df37e91fd96c68.tar.gz
rust-ced7cc5c6523ff478599ed9188df37e91fd96c68.zip
Auto merge of #56090 - nnethercote:filesearch, r=eddyb
Overhaul `FileSearch` and `SearchPaths`

`FileSearch::search()` traverses one or more directories. For each
directory it generates a `Vec<PathBuf>` containing one element per file
in that directory.

In some benchmarks this occurs enough that the allocations done for the
`PathBuf`s are significant, and in practice a small number of
directories are being traversed over and over again. For example, when
compiling the `tokio-webpush-simple` benchmark, two directories are
traversed 58 times each. Each of these directories have more than 100
files.

We can do all the necessary traversals up front, when `Session` is created,
and get the `Vec<PathBuf>`s then.

This reduces instruction counts on several benchmarks by 1--5%.

r? @alexcrichton

CC @eddyb, @michaelwoerister, @nikomatsakis
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions