Skip to content

Use File::metadata instead of fs::metadata to choose buffer size #47520

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 18, 2018

Conversation

mbrubeck
Copy link
Contributor

This replaces a stat syscall with fstat or similar, which can be faster. Fixes #47519.

This replaces a `stat` syscall with `fstat` or similar, which can be
faster.  Fixes rust-lang#47519.
@rust-highfive
Copy link
Contributor

r? @shepmaster

(rust_highfive has picked a reviewer for you, use r? to override)

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 17, 2018

📌 Commit e9fdee8 has been approved by Mark-Simulacrum

@Mark-Simulacrum Mark-Simulacrum added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 17, 2018
@mbrubeck
Copy link
Contributor Author

I confirmed this speeds up these functions by a small constant amount on my Linux system. Example speedup:

test read_32kb_alloc  ... bench:       3,159 ns/iter (+/- 693)
test read_32kb_alloc2 ... bench:       2,875 ns/iter (+/- 395)

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 17, 2018
Use File::metadata instead of fs::metadata to choose buffer size

This replaces a `stat` syscall with `fstat` or similar, which can be faster.  Fixes rust-lang#47519.
bors added a commit that referenced this pull request Jan 18, 2018
Rollup of 6 pull requests

- Successful merges: #47250, #47313, #47398, #47468, #47471, #47520
- Failed merges:
@bors bors merged commit e9fdee8 into rust-lang:master Jan 18, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants