From b4bbf44a0aebb526befeb39757634050f86f038e Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 6 Oct 2016 17:32:26 +0000 Subject: [PATCH] runtime: buffer writes of RPC data. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This improves upload speed ~166×. --- artiq/runtime.rs/src/rpc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artiq/runtime.rs/src/rpc.rs b/artiq/runtime.rs/src/rpc.rs index beef28119..21b966dc9 100644 --- a/artiq/runtime.rs/src/rpc.rs +++ b/artiq/runtime.rs/src/rpc.rs @@ -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(()),