about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-04-08 03:20:11 -0700
committerbors <bors@rust-lang.org>2016-04-08 03:20:11 -0700
commit8694b4ffe9b223c351e50c10bd8ea4e23af58baa (patch)
tree6f73505d90ae5b0fd71ef7bf3d115287a5203ccb /src
parentdde35e75a30129fdc61bb179023a9f0dbdc7a79a (diff)
parent8128817119e479b0610685e3fc7a6ff21cde5abc (diff)
downloadrust-8694b4ffe9b223c351e50c10bd8ea4e23af58baa.tar.gz
rust-8694b4ffe9b223c351e50c10bd8ea4e23af58baa.zip
Auto merge of #32695 - sfackler:default-buf-size, r=alexcrichton
Drop the default buffer size to 8K

The 64k capacity was picked by me a couple of years ago in the initial
implementation of buffered IO adaptors:
https://github.com/rust-lang/rust/pull/9091/files#diff-b131eeef531ad098b32f49695a031008R62.
64K was picked for symmetry with libuv, which we no longer use.

64K is *way* larger than the default size of any other language that I
can find. C, C++, and Java default to 8K, and Go defaults to 4K. There
have been a variety of issues filed relating to this such as #31885.

Closes #31885
Diffstat (limited to 'src')
-rw-r--r--src/libstd/io/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 0f988c7623e..bcce8ee6abf 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -292,7 +292,7 @@ mod lazy;
 mod util;
 mod stdio;
 
-const DEFAULT_BUF_SIZE: usize = 64 * 1024;
+const DEFAULT_BUF_SIZE: usize = 8 * 1024;
 
 // A few methods below (read_to_string, read_line) will append data into a
 // `String` buffer, but we need to be pretty careful when doing this. The