~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_chk_map_py.py

  • Committer: John Arbash Meinel
  • Date: 2010-05-11 10:45:26 UTC
  • mto: This revision was merged to the branch mainline in revision 5225.
  • Revision ID: john@arbash-meinel.com-20100511104526-zxnstcxta22hzw2n
Implement a compiled extension for parsing the text key out of a CHKInventory value.

Related to bug #562666. This seems to shave 5-10% out of the time spent doing a complete
branch of bzr.dev/launchpad/etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
    result._node_width = len(prefix)
158
158
    result._search_prefix = common_prefix
159
159
    return result
 
160
 
 
161
 
 
162
def _bytes_to_text_key(bytes):
 
163
    """Take a CHKInventory value string and return a (file_id, rev_id) tuple"""
 
164
    sections = bytes.split('\n')
 
165
    kind, file_id = sections[0].split(': ')
 
166
    return (intern(file_id), intern(sections[3]))
 
167