~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tuned_gzip.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-08 03:34:57 UTC
  • mto: This revision was merged to the branch mainline in revision 1937.
  • Revision ID: john@arbash-meinel.com-20060808033457-406d62b14bedabe8
Some small tweaks to knit and tuned_gzip to shave off another couple seconds

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Bzrlib specific gzip tunings. We plan to feed these to the upstream gzip."""
19
19
 
 
20
import cStringIO
 
21
 
20
22
# make GzipFile faster:
21
23
import gzip
22
24
from gzip import U32, LOWU32, FEXTRA, FCOMMENT, FNAME, FHCRC
279
281
        # to :
280
282
        # 4168 calls in 417.
281
283
        # Negative numbers result in reading all the lines
282
 
        if sizehint <= 0:
283
 
            sizehint = -1
284
 
        content = self.read(sizehint)
285
 
        return bzrlib.osutils.split_lines(content)
 
284
        content = cStringIO.StringIO(self.read(-1))
 
285
        return content.readlines()
286
286
 
287
287
    def _unread(self, buf, len_buf=None):
288
288
        """tuned to remove unneeded len calls.