about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-11-11 10:08:03 -0800
committerAlex Crichton <alex@alexcrichton.com>2013-11-11 10:08:03 -0800
commitcdf7d63bfce33d2390e3a0a27e01a07f262834e7 (patch)
treebeb67163fe1f02431c45b8d676d86ce6cd3bc18f /src/rustllvm/RustWrapper.cpp
parent4059b5c4b3b8a57a645982b0770d25f0283dfb06 (diff)
downloadrust-cdf7d63bfce33d2390e3a0a27e01a07f262834e7.tar.gz
rust-cdf7d63bfce33d2390e3a0a27e01a07f262834e7.zip
Optimize creation of buffered readers/writers
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.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions