2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 11:18:27 +08:00

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

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(()),