From 9e681590cb3331bbbad358125164cfb2b13715ba Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Sat, 21 May 2016 19:08:22 +0200 Subject: [PATCH] pyon: ship ndarray data as bytes this is about 3 times faster and since the encapsulating nparray() already breaks json-compatibility, using a unicode string for json compatibility is not necessary --- artiq/protocols/pyon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/protocols/pyon.py b/artiq/protocols/pyon.py index 394965434..b72a7f9b3 100644 --- a/artiq/protocols/pyon.py +++ b/artiq/protocols/pyon.py @@ -141,14 +141,14 @@ class _Encoder: r = "nparray(" r += self.encode(x.shape) + ", " r += self.encode(x.dtype.str) + ", " - r += self.encode(base64.b64encode(x).decode()) + r += self.encode(base64.b64encode(x.data)) r += ")" return r def encode_npscalar(self, x): r = "npscalar(" r += self.encode(x.dtype.str) + ", " - r += self.encode(base64.b64encode(x).decode()) + r += self.encode(base64.b64encode(x.data)) r += ")" return r