Project

General

Profile

Actions

Feature #17685

closed

Marshal format for out of band buffer objects

Added by dsisnero (Dominic Sisneros) about 3 years ago. Updated about 3 years ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:102810]

Description

Allow the use of the marshal protocol to transmit large data (objects) from one process or ractor to another, on same machine or multiple machines without extra memory copies of the data.

See Python PEP 574 - https://www.python.org/dev/peps/pep-0574/ Pickle protocol with out of band data.

When marshalling memoryview objects, it would be nice to be able to use zero copy loads of the memoryviews. That way when loading the file we can use that memoryview without copying it also if desired.

Add a Marshal::Buffer type in new version of Marshal to represent something that indicates a serializable no-copy buffer view.

The marshal_dump must be able to represent references to a Marshal::Buffer to indicate that the loader might get the actual buffer out of band

The marshal_load must be able to provide the Marshal::Buffer for deserialization

Marshal load and dump should work normally if not used out of band.

class Apache::Arrow
  
  def marshal_dump(*)
     if marshal.version > '0.4'
         Marshal::Buffer.new(self)
     else
        #normal dump
     end
  end
end
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0