diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-11-11 10:08:03 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-11-11 10:08:03 -0800 |
| commit | cdf7d63bfce33d2390e3a0a27e01a07f262834e7 (patch) | |
| tree | beb67163fe1f02431c45b8d676d86ce6cd3bc18f /src/rustllvm/RustWrapper.cpp | |
| parent | 4059b5c4b3b8a57a645982b0770d25f0283dfb06 (diff) | |
| download | rust-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
