Ignore writeable frames with builtin `array`
As the builtin `array` needs to own its data (meaning it will always
copy), simply mark its frames to ignore tracking whether they are
writeable. This avoids an unneeded copy during deserialization.
@@ -628,7 +628,7 @@ def _deserialize_bytearray(header, frames):
@dask_serialize.register(array)
def _serialize_array(obj):
- header = {"typecode": obj.typecode}
+ header = {"typecode": obj.typecode, "writeable": (None,)}
frames = [memoryview(obj)]
return header, frames
