runtime: buffer writes of RPC data.

This improves upload speed ~166×.
This commit is contained in:
whitequark 2016-10-06 17:32:26 +00:00
parent 557bc4bb56
commit b4bbf44a0a
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,5 @@
use std::slice;
use std::io::{self, Read, Write};
use std::io::{self, Read, Write, BufWriter};
use proto::*;
use self::tag::{Tag, TagIterator, split_tag};
@ -98,6 +98,7 @@ unsafe fn send_value(writer: &mut Write, tag: Tag, data: &mut *const ()) -> io::
})
}
let writer = &mut BufWriter::new(writer);
try!(write_u8(writer, tag.as_u8()));
match tag {
Tag::None => Ok(()),