Hacker News new | ask | show | jobs
by kentonv 4664 days ago
So, as the author of Cap'n Proto I'm biased -- though I'm also the author of Protobufs v2, so I'm not completely biased. :)

"Infinitely faster" is of course meant more to illustrate how Cap'n Proto works than to be taken as a literal speed measure. Although, if you actually wanted to compare Cap'n Proto to Protobufs, it's unclear what other number you can really come up with. The normal way to compare Protobuf speed vs. anything else is to measure the encode or decode step, but Cap'n Proto has no such step. You can measure an end-to-end system using one vs. the other, but then on the Cap'n Proto side you are basically measuring the speed of everything _except_ the Cap'n Proto code.

The git repo includes some contrived benchmarks along those lines which you can try out. I don't post the numbers because I'm not sure they are meaningful (even though they appear very favorable for Cap'n Proto). I'm really hoping to see a few unbiased third parties benchmark Cap'n Proto vs. Protobufs in real-world systems at some point.

Of course, the larger point here is that Cap'n Proto allows you to do things that Protobuf simply doesn't support, like mmap()ing in a large file and reading one field out of it in constant time, whereas with Protobuf you have to parse the whole thing making it O(size of file) time.

1 comments

Thanks a lot for the reply, one of my favorite things about HN is getting questions answered by the authors of the tool in question. After reading more, your decision to not post those benchmarks is a smart one. I get where you're coming from with regards to it being hard to make a performance comparison to protobufs, it makes sense now. If/when I need to reach for some serialization I'll certainly try out Cap'n Proto.
> If/when I need to reach for some serialization I'll certainly try out Cap'n Proto.

If/when you do, remember that the mailing list is friendly and we very much want to hear your feedback and help you with any problems. :)