title: Which compression algorithm is better suited to compress protocol buffers output?
body: <p>Given:</p>
  
  <ul>
  <li>a DB table with numeric statistics only</li>
  <li>binary dump of the table - record after record</li>
  <li>protocol buffers dump of the table - using proto schema created from the table schema</li>
  </ul>
  
  <p>As I have expected the binary dump produced by the protocol buffers is smaller than the naive binary dump of the same table:</p>
  
  <pre><code>PS Z:\dev\internal\vedtool&gt; dir net_endshapes_stat.data | % { "$($_.Name): $($_.Length)B" }
  net_endshapes_stat.data: 2941331B
  net_endshapes_stat.data: 4311042B
  </code></pre>
  
  <p>However, when I compressed both files with 7z using Ultra level and LZMA method, I have discovered that the larger file compresses better:</p>
  
  <pre><code>PS Z:\dev\internal\vedtool&gt; dir net_endshapes_stat.7z | % { "$($_.Name): $($_.Length)B" }
  net_endshapes_stat.7z: 1206186B
  net_endshapes_stat.7z: 1055901B
  </code></pre>
  
  <p>Now, I understand that it is completely OK, still I am wondering whether there is a compression algorithm better tuned to perform on the protocol buffers output.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is the proto schema:</p>
  
  <pre><code>message net_endshapes_stat {
    optional fixed32 timestamp = 1;
    optional sint32 shape_id = 2;
    optional sint64 bps_in = 3;
    optional sint64 bps_out = 4;
    optional sint64 total_in = 5;
    optional sint64 total_out = 6;
  }
  </code></pre>