Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchIndexer takes time indexing \target on windows #8694

Closed
Eh2406 opened this issue Sep 9, 2020 · 5 comments · Fixed by #9635
Closed

SearchIndexer takes time indexing \target on windows #8694

Eh2406 opened this issue Sep 9, 2020 · 5 comments · Fixed by #9635
Assignees
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` O-windows OS: Windows Performance Gotta go fast!

Comments

@Eh2406
Copy link
Contributor

Eh2406 commented Sep 9, 2020

Windows Search Indexer can spend significant time interrupting project builds. This is mostly a problem on older computers with slower hard drives, but can be measurable on all systems.
image

Unchecking the "allow files in this folder to have contents indexed" seams to help. (on cmd attrib +I target) There may be other setting that can also help. Can Cargo programmatically check that flag when it crates target?

@Eh2406 Eh2406 added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Sep 9, 2020
@weihanglo
Copy link
Member

Looks like we get this issue on macOS too (#8684). Is there any chance to reuse some logic between OSs?

@Eh2406
Copy link
Contributor Author

Eh2406 commented Sep 10, 2020

I was inspired to report this during discussion of #8684. It is conceptually related, but the implementation is likely to be more straightforward. Hopefully it can build on the code for

fn exclude_from_time_machine(path: &Path) {

@alexcrichton
Copy link
Member

According to SetFileAttributes the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED may be useful here, but I think that would need to be tested if that affected folders. According to this, though, it may be what we want here.

@ehuss ehuss added O-windows OS: Windows Performance Gotta go fast! labels Sep 19, 2020
@toothbrush7777777
Copy link
Contributor

I'll work on this.
@rustbot claim

@pravic
Copy link

pravic commented Jun 24, 2021

The file or directory is not to be indexed by the content indexing service.

So, it should work with directories as well.

bors added a commit that referenced this issue Jun 30, 2021
Exclude `target` from content-indexing on Windows

This has a noticeable performance improvement for most projects, especially when the storage device is a hard drive.

Closes #8694
@bors bors closed this as completed in 9d96a88 Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` O-windows OS: Windows Performance Gotta go fast!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants