Commit holds 2 copies of compressed content

Bug #684301 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

At the moment, commit reads 1 full text, then uses zlib.compress() on that. It then ends up copying that compressed text again, in order to finish the commit.

Bug #566940 has more details (though now slightly outdated).

The basics are that we have a few places in the code that add header information to the content stream before they write the content. And to saves syscalls, we do that by concatenating then writing. Instead, we should try to do that with 'chunked' content streams.

So instead of doing:

def data_with_header(content):
  my_header = '%s %s' % (stuff)
  return my_header + content

using

def data_with_header(chunked_content):
  new_content = ['%s %s' % (stuff)]
  new_content.extend(chunked_content)
  return new_content

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.