title: Boost IO Stream and ZLib speed up
body: <p>I have a large file of data I have compressed with Zlib using boost IOStreams and filtering stream buffers:</p>
  
  <pre><code>boost::iostreams::array_source uncompressedArray( reinterpret_cast&lt; const char* &gt;( &amp;uncompressedData[0] ), uncompressedData.size() );
  
  boost::iostreams::filtering_streambuf&lt; boost::iostreams::output &gt; out;
  out.push( *m_compressor );
  out.push( boost::iostreams::char_back_inserter( compressedData ) );
  boost::iostreams::copy( uncompressedArray, out );
  </code></pre>
  
  <p>For speed I am initializing the zlib library with the following:</p>
  
  <pre><code>boost::iostreams::zlib_params params;
  params.level = boost::iostreams__zlib::best_speed;
  params.mem_level = 9;
  
  m_compressor.reset( new boost::iostreams::zlib_compressor( params, 131072 ) );
  m_decompressor.reset( new boost::iostreams::zlib_decompressor( params, 131072 ) );
  </code></pre>
  
  <p>My decompressor looks like this:</p>
  
  <pre><code>boost::iostreams::array_source compressedArray( reinterpret_cast&lt; const char* &gt;( &amp;compressedData[0] ), compressedData.size() );
  
  boost::iostreams::filtering_streambuf&lt; boost::iostreams::input &gt; m_in;
  m_in.push( *m_decompressor );
  m_in.push( compressedArray );       
  boost::iostreams::copy( m_in, boost::iostreams::char_back_inserter( uncompressedData ) );
  </code></pre>
  
  <p>My question is are there any ways I can speed up the inflate (decompress) operation? Right now the compression is taking about 83% of my data access time and I really need to get this faster.  Any suggestions would be greatly appreciated.</p>