Added a double buffer to serialization, to reduce vector initialization