Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> There is a validation step of course

No, there isn't. Not any more than there is a decode step anyway.

The truth is that encoding, decoding, and validation all occur when you call the accessor methods for specific fields. If you never actually call the getter for some field, it won't be decoded nor validated at all.

If you are going to be reading the entire message tree, then zero-copy is only an incremental improvement on something like Protobuf -- the use of fixed-width values may make decoding faster (or slower, in some cases). The real magic is when you want to read just one field of a 10GB file. Just mmap() the whole thing and treat it like a byte array, and it'll be efficient. Cap'n Proto will not attempt to scan the whole file, only the parts that you explicitly query.

(I'm the author of Cap'n Proto.)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: