]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #10424 : alexcrichton/rust/optimize-buffered, r=brson
authorbors <bors@rust-lang.org>
Tue, 12 Nov 2013 03:31:14 +0000 (19:31 -0800)
committerbors <bors@rust-lang.org>
Tue, 12 Nov 2013 03:31:14 +0000 (19:31 -0800)
I was benchmarking rust-http recently, and I saw that 50% of its time was spent
creating buffered readers/writers. Albeit rust-http wasn't using
std::rt::io::buffered, but the same idea applies here. It's much cheaper to
malloc a large region and not initialize it than to set it all to 0. Buffered
readers/writers never use uninitialized data, and their internal buffers are
encapsulated, so any usage of uninitialized slots are an implementation bug in
the readers/writers.


Trivial merge