~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

Partial fix for bug #566940.

Destroy the existing compressor object sooner. It holds on to
a copy of the block which references the uncompressed text
chunks. However we don't need either anymore. Just get rid
of it sooner.

We still seem to have 3x the compressed text size, but that
is better than 3x the compressed size +1x the original text
size.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1641
1641
        keys_to_add = []
1642
1642
        def flush():
1643
1643
            bytes = self._compressor.flush().to_bytes()
 
1644
            self._compressor = GroupCompressor()
1644
1645
            index, start, length = self._access.add_raw_records(
1645
1646
                [(None, len(bytes))], bytes)[0]
1646
1647
            nodes = []
1649
1650
            self._index.add_records(nodes, random_id=random_id)
1650
1651
            self._unadded_refs = {}
1651
1652
            del keys_to_add[:]
1652
 
            self._compressor = GroupCompressor()
1653
1653
 
1654
1654
        last_prefix = None
1655
1655
        max_fulltext_len = 0