diff options
| author | Chris Denton <chris@chrisdenton.dev> | 2023-04-21 20:53:21 +0100 |
|---|---|---|
| committer | Chris Denton <chris@chrisdenton.dev> | 2023-04-21 20:54:12 +0100 |
| commit | f74fe8bf4ca773e416d4da3a3bf37045b06ea3de (patch) | |
| tree | 828455c5b97c5af6b7b87c46f6f6068f09f06743 /library/std/src/io/tests.rs | |
| parent | fa4cc63a6bd6f32903269e52b8f59b284d0e76c4 (diff) | |
| download | rust-f74fe8bf4ca773e416d4da3a3bf37045b06ea3de.tar.gz rust-f74fe8bf4ca773e416d4da3a3bf37045b06ea3de.zip | |
Limit read size in `File::read_to_end` loop
This works around performance issues on Windows by limiting reads the size of reads when the expected size is known.
Diffstat (limited to 'library/std/src/io/tests.rs')
| -rw-r--r-- | library/std/src/io/tests.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/io/tests.rs b/library/std/src/io/tests.rs index f4a886d889a..6d30f5e6c6c 100644 --- a/library/std/src/io/tests.rs +++ b/library/std/src/io/tests.rs @@ -314,7 +314,7 @@ fn bench_read_to_end(b: &mut test::Bencher) { b.iter(|| { let mut lr = repeat(1).take(10000000); let mut vec = Vec::with_capacity(1024); - super::default_read_to_end(&mut lr, &mut vec) + super::default_read_to_end(&mut lr, &mut vec, None) }); } |
