~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/chunk_writer.py

  • Committer: John Arbash Meinel
  • Date: 2008-08-22 05:54:44 UTC
  • mto: This revision was merged to the branch mainline in revision 3653.
  • Revision ID: john@arbash-meinel.com-20080822055444-5kcr0csbbvkqbbiw
If we repack earlier, it catches this case.
Still need to fix the other tests, but at least
the too_much test passes now.
Impact on real-world results is measurable
(2-3% final compression). Is it worth it?

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
            if out:
178
178
                self.bytes_list.append(out)
179
179
                self.bytes_out_len += len(out)
180
 
            if self.bytes_out_len + 10 <= capacity:
 
180
 
 
181
            # We are a bit extra conservative, because it seems that you *can*
 
182
            # get better compression with Z_SYNC_FLUSH than a full compress. It
 
183
            # is probably very rare, but we were able to trigger it.
 
184
            if self.bytes_out_len + 100 <= capacity:
181
185
                # It fit, so mark it added
182
186
                self.bytes_in.append(bytes)
183
187
                self.seen_bytes += len(bytes)