Skip to content

Commit

Permalink
Rollup merge of rust-lang#32695 - sfackler:default-buf-size, r=alexcr…
Browse files Browse the repository at this point in the history
…ichton

 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 rust-lang#31885.

Closes rust-lang#31885
  • Loading branch information
Manishearth committed Apr 8, 2016
2 parents 1d59b91 + 8128817 commit ec5258e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec5258e

Please sign in to comment.