The protobuf varint format itself actually is pretty expensive to decode--  the way it&#x27;s encoded pretty much mandates a branch per seven bit chunk (of the resulting integer); you can&#x27;t tell in advance how long an integer is (as opposed to a length-prefixed varint, where you can).<p>That&#x27;s in addition to the encoding-independent overhead inherent to any variable-length integer scheme, which is what mandates the encoding&#x2F;decoding step in protobuf.  Combined, this makes protobuf pretty expensive to decode (protobuf varints are everywhere; they&#x27;re used for field keys and length delimiters for length-delimited field types).<p>That&#x27;s unrelated to ZigZag encoding of negative numbers, though, which is fairly straightforward and computationally inexpensive (it&#x27;s a couple bitshifts and an XOR).