title: How does protobuf-net achieve respectable performance?
body: <p>I want to understand why <a href="http://code.google.com/p/protobuf-net/" rel="noreferrer">the protocol buffers solution for .NET</a> developed by <a href="https://stackoverflow.com/users/23354/marc-gravell">Marc Gravell</a> is as fast as it is. </p>
  
  <p>I can understand how the original Google solution achieved its performance: it pre-generates optimized code for object serialization; I've written some serialization by hand and know that it is possible to write pretty fast code this way if you avoid reflection. But Marc's library is a runtime solution that uses attributes and doesn't produce any generated code. So how does it work ? </p>