Optimize serialization

Serialization is now competitive with go's serialization, with
~60MB/s in the bench_logs test.
This commit is contained in:
Erick Tryzelaar
2014-06-22 10:33:45 -04:00
parent ee162975f9
commit ec8dd2f5a0
6 changed files with 551 additions and 750 deletions
+6 -3
View File
@@ -237,7 +237,10 @@ macro_rules! impl_serialize_tuple {
let ($(ref $name,)*) = *self;
try!(s.serialize_tuple_start(len));
$(try!($name.serialize(s));)*
$(
try!(s.serialize_tuple_sep());
try!($name.serialize(s));
)*
s.serialize_tuple_end()
}
}
@@ -299,7 +302,7 @@ mod tests {
try!(s.serialize_struct_sep("inner"));
try!(self.inner.serialize(s));
s.serialize_enum_end()
s.serialize_struct_end()
}
}
@@ -680,7 +683,7 @@ mod tests {
Char('c'),
MapEnd,
StructEnd,
StructEnd,
SeqEnd,
StructEnd,
);