From 5133c46fe5f9ff71d0978b1ebb087b42b524f12e Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 7 Aug 2014 15:33:54 -0400 Subject: [PATCH] avoid an extra tuple allocation in deserializing 1d arrays. slightly helps #7893 --- base/serialize.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/serialize.jl b/base/serialize.jl index 3fc127fde606a..8b852d66bc3f8 100644 --- a/base/serialize.jl +++ b/base/serialize.jl @@ -403,6 +403,9 @@ function deserialize(s, ::Type{Array}) elty = Uint8 end if isa(d1,Integer) + if elty !== Bool && isbits(elty) + return read!(s, Array(elty, d1)) + end dims = (int(d1),) else dims = convert(Dims, d1)::Dims