- ID de exploración:
- 14c24e3a-76dc-4967-8991-dfa8d908ae66Finalizado
- URL enviada:
- https://capnproto.org/
- Informe finalizado:
Enlaces: 12 encontrados
Los enlaces salientes identificados en la página
Enlace | TEXTO |
---|---|
https://groups.google.com/group/capnproto | discussion group |
https://github.com/capnproto/capnproto | View on GitHub |
https://github.com/protocolbuffers/protobuf | Protocol Buffers |
http://www.zlib.net/ | zlib |
https://github.com/Cyan4973/lz4 | LZ4 |
https://sandstorm.io | Sandstorm.io |
https://workers.dev | Cloudflare Workers |
https://twitter.com/BenLaurie/status/575079375307153409 | “the most awesome response I’ve ever had.” |
https://groups.google.com/group/capnproto-announce | announcement list |
https://twitter.com/capnproto |
Variables JavaScript: 7 encontradas
Las variables JavaScript globales cargadas en el objeto de ventana de una página son variables declaradas fuera de las funciones y a las que se puede acceder desde cualquier lugar del código en el ámbito actual
Nombre | Tipo |
---|---|
onbeforetoggle | object |
documentPictureInPicture | object |
onscrollend | object |
initSidebar | function |
setupSidebar | function |
setupNewsSidebar | function |
setupSlides | function |
Mensajes de registro de la consola: 1 encontrados
Mensajes registrados en la consola web
Tipo | Categoría | Registrar |
---|---|---|
error | network |
|
HTML
El cuerpo HTML sin procesar de la página
<!DOCTYPE html><html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=480">
<link rel="stylesheet" type="text/css" media="screen" href="/stylesheets/stylesheet.css">
<link rel="alternate" type="application/rss+xml" title="Cap'n Proto News" href="/feed.xml">
<title>Cap'n Proto: Introduction</title>
<script type="text/javascript" src="/javascripts/main.js"></script>
</head>
<body class="narrow">
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<img src="/images/logo.png">
<div id="infinitely_faster">
<img src="/images/infinitely_faster.png">
</div>
</header>
<a id="discuss_banner" href="https://groups.google.com/group/capnproto">Discuss on Groups</a>
<a id="forkme_banner" href="https://github.com/capnproto/capnproto">View on GitHub</a>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner" style="min-height: 0px;">
<h1 id="introduction">Introduction</h1>
<p><img src="images/infinity-times-faster.png" style="width:334px; height:306px; float: right;"></p>
<p>Cap’n Proto is an insanely fast data interchange format and capability-based RPC system. Think
JSON, except binary. Or think <a href="https://github.com/protocolbuffers/protobuf">Protocol Buffers</a>, except faster.
In fact, in benchmarks, Cap’n Proto is INFINITY TIMES faster than Protocol Buffers.</p>
<p>This benchmark is, of course, unfair. It is only measuring the time to encode and decode a message
in memory. Cap’n Proto gets a perfect score because <em>there is no encoding/decoding step</em>. The Cap’n
Proto encoding is appropriate both as a data interchange format and an in-memory representation, so
once your structure is built, you can simply write the bytes straight out to disk!</p>
<p><strong><em>But doesn’t that mean the encoding is platform-specific?</em></strong></p>
<p>NO! The encoding is defined byte-for-byte independent of any platform. However, it is designed to
be efficiently manipulated on common modern CPUs. Data is arranged like a compiler would arrange a
struct – with fixed widths, fixed offsets, and proper alignment. Variable-sized elements are
embedded as pointers. Pointers are offset-based rather than absolute so that messages are
position-independent. Integers use little-endian byte order because most CPUs are little-endian,
and even big-endian CPUs usually have instructions for reading little-endian data.</p>
<p><strong><em>Doesn’t that make backwards-compatibility hard?</em></strong></p>
<p>Not at all! New fields are always added to the end of a struct (or replace padding space), so
existing field positions are unchanged. The recipient simply needs to do a bounds check when
reading each field. Fields are numbered in the order in which they were added, so Cap’n Proto
always knows how to arrange them for backwards-compatibility.</p>
<p><strong><em>Won’t fixed-width integers, unset optional fields, and padding waste space on the wire?</em></strong></p>
<p>Yes. However, since all these extra bytes are zeros, when bandwidth matters, we can apply an
extremely fast Cap’n-Proto-specific compression scheme to remove them. Cap’n Proto calls this
“packing” the message; it achieves similar (better, even) message sizes to protobuf encoding, and
it’s still faster.</p>
<p>When bandwidth really matters, you should apply general-purpose compression, like
<a href="http://www.zlib.net/">zlib</a> or <a href="https://github.com/Cyan4973/lz4">LZ4</a>, regardless of your
encoding format.</p>
<p><strong><em>Isn’t this all horribly insecure?</em></strong></p>
<p>No no no! To be clear, we’re NOT just casting a buffer pointer to a struct pointer and calling it a day.</p>
<p>Cap’n Proto generates classes with accessor methods that you use to traverse the message. These accessors validate pointers before following them. If a pointer is invalid (e.g. out-of-bounds), the library can throw an exception or simply replace the value with a default / empty object (your choice).</p>
<p>Thus, Cap’n Proto checks the structural integrity of the message just like any other serialization protocol would. And, just like any other protocol, it is up to the app to check the validity of the content.</p>
<p>Cap’n Proto was built to be used in <a href="https://sandstorm.io">Sandstorm.io</a>, and is now heavily used in <a href="https://workers.dev">Cloudflare Workers</a>, two environments where security is a major concern. Cap’n Proto has undergone fuzzing and expert security review. Our response to security issues was once described by security guru Ben Laurie as <a href="https://twitter.com/BenLaurie/status/575079375307153409">“the most awesome response I’ve ever had.”</a> (Please report all security issues to <a href="mailto:[email protected]">[email protected]</a>.)</p>
<p><strong><em>Are there other advantages?</em></strong></p>
<p>Glad you asked!</p>
<ul>
<li><strong>Incremental reads:</strong> It is easy to start processing a Cap’n Proto message before you have
received all of it since outer objects appear entirely before inner objects (as opposed to most
encodings, where outer objects encompass inner objects).</li>
<li><strong>Random access:</strong> You can read just one field of a message without parsing the whole thing.</li>
<li><strong>mmap:</strong> 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.</li>
<li><strong>Inter-language communication:</strong> 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.</li>
<li><strong>Inter-process communication:</strong> 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.</li>
<li><strong>Arena allocation:</strong> Manipulating Protobuf objects tends to be bogged down by memory
allocation, unless you are very careful about object reuse. Cap’n Proto objects are always
allocated in an “arena” or “region” style, which is faster and promotes cache locality.</li>
<li><strong>Tiny generated code:</strong> Protobuf generates dedicated parsing and serialization code for every
message type, and this code tends to be enormous. Cap’n Proto generated code is smaller by an
order of magnitude or more. In fact, usually it’s no more than some inline accessor methods!</li>
<li><strong>Tiny runtime library:</strong> Due to the simplicity of the Cap’n Proto format, the runtime library
can be much smaller.</li>
<li><strong>Time-traveling RPC:</strong> Cap’n Proto features an RPC system that implements <a href="rpc.html">time travel</a>
such that call results are returned to the client before the request even arrives at the server!</li>
</ul>
<p><a href="rpc.html"><img src="images/time-travel.png" style="max-width:639px"></a></p>
<p><strong><em>Why do you pick on Protocol Buffers so much?</em></strong></p>
<p>Because it’s easy to pick on myself. :) I, Kenton Varda, was the primary author of Protocol Buffers
version 2, which is the version that Google released open source. Cap’n Proto is the result of
years of experience working on Protobufs, listening to user feedback, and thinking about how
things could be done better.</p>
<p>Note that I no longer work for Google. Cap’n Proto is not, and never has been, affiliated with Google.</p>
<p><strong><em>OK, how do I get started?</em></strong></p>
<p>To install Cap’n Proto, head over to the <a href="install.html">installation page</a>. If you’d like to help
hack on Cap’n Proto, such as by writing bindings in other languages, let us know on the
<a href="https://groups.google.com/group/capnproto">discussion group</a>. If you’d like to receive e-mail
updates about future releases, add yourself to the
<a href="https://groups.google.com/group/capnproto-announce">announcement list</a>.</p>
<div style="float: right">
<a class="github_link" style="color: #fff" href="https://github.com/capnproto/capnproto">Develop</a>
<a class="groups_link" style="color: #fff" href="https://groups.google.com/group/capnproto">Discuss</a>
<a class="groups_link" style="color: #fff" href="https://groups.google.com/group/capnproto-announce">Stay Updated</a>
<a class="twitter_link" style="color: #fff" href="https://twitter.com/capnproto">Twitter</a>
</div>
<div style="clear: right;"> </div>
<div style="clear: both;"></div>
</section>
<section id="menu" class="">
<ul>
<li class="selected">Introduction<ul id="toc"></ul></li>
<li><a href="/news/">News</a></li>
<li><a href="/install.html">Installation</a></li>
<li><a href="/language.html">Schema Language</a></li>
<li><a href="/encoding.html">Encoding</a></li>
<li><a href="/rpc.html">RPC Protocol</a></li>
<li><a href="/capnp-tool.html">The <code>capnp</code> Tool</a></li>
<li><a href="/cxx.html">C++ Serialization</a></li>
<li><a href="/cxxrpc.html">C++ RPC</a></li>
<li><a href="/otherlang.html">Other Languages</a></li>
<li><a href="/roadmap.html">Road Map</a></li>
<li><a href="/faq.html">FAQ</a></li>
</ul>
</section>
<script type="text/javascript">setupSidebar()</script>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p>Maintained by <a href="https://github.com/kentonv">kentonv</a> and friends ∙ Design by <a href="https://twitter.com/sailorhg">sailorhg</a>
</p><p><a href="https://twitter.com/capnproto">Follow Cap'n Proto on Twitter</a></p>
</footer>
</div>
</body></html>