Skip to content

Commit

Permalink
runtime: buffer writes of RPC data.
Browse files Browse the repository at this point in the history
This improves upload speed ~166×.
whitequark committed Oct 6, 2016
1 parent 557bc4b commit b4bbf44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion artiq/runtime.rs/src/rpc.rs
Original file line number Diff line number Diff line change
@@ -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(()),

0 comments on commit b4bbf44

Please sign in to comment.