Cap'n Proto for D v0.1.2

Jay Norwood via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Apr 19 09:34:02 PDT 2017


On Tuesday, 18 April 2017 at 18:09:54 UTC, Thomas Brix Larsen 
wrote:
> "Cap’n Proto is an insanely fast data interchange format and 
> capability-based RPC system. Think JSON, except binary. Or 
> think Protocol Buffers, except faster."

The features below, from the capnproto.org description, interest 
me.  However a MappedByteBuffer would be used for the mmap 
feature in java.

https://capnproto.org/

mmap: Read a large Cap’n Proto file by memory-mapping it. The OS 
won’t even read in the parts that you don’t access.

Inter-language communication: Calling C++ code from, say, Java or 
Python tends to be painful or slow. With Cap’n Proto, the two 
languages can easily operate on the same in-memory data structure.

Inter-process communication: Multiple processes running on the 
same machine can share a Cap’n Proto message via shared memory. 
No need to pipe data through the kernel. Calling another process 
can be just as fast and easy as calling another thread.

This info from stackoverflow also seems to imply that 
MappedByteBuffer would be required for some of the capnproto 
features.  So, could you explain a little more about what are the 
capabilities of the current d library implementation, with just 
the ByteBuffer implemented from the java nio code?  Thanks, Jay

http://stackoverflow.com/questions/29361058/read-proto-partly-instead-of-full-parsing-in-java

'If you are willing to consider using a different protocol 
framework, Cap'n Proto is extremely similar in design to 
Protobufs but features in the ability to read only the part of 
the message you care about. Cap'n Proto incurs no overhead for 
the fields you don't examine, other than obviously the bandwidth 
and memory to receive the raw message bytes. If you are reading 
from a file, and you use memory mapping (MappedByteBuffer in 
Java), then only the parts of the message you actually use will 
be read from disk.'







More information about the Digitalmars-d-announce mailing list