/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/_dirstate_helpers_pyx.pyx

  • Committer: John Arbash Meinel
  • Date: 2010-08-02 22:07:54 UTC
  • mto: This revision was merged to the branch mainline in revision 5393.
  • Revision ID: john@arbash-meinel.com-20100802220754-jvtkt7dtuwon2gdk
id_index size drops to 230kB with StaticTuples.
Even better, though, is that using StaticTuple in the parser gives us
an overall benefit of about 20%. It isn't our biggest data use, but
it is something, at least.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2008, 2010 Canonical Ltd
 
1
# Copyright (C) 2007-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
118
118
    # ??? memrchr is a GNU extension :(
119
119
    # void *memrchr(void *s, int c, size_t len)
120
120
 
 
121
# cimport all of the definitions we will need to access
 
122
from _static_tuple_c cimport StaticTuple,\
 
123
    import_static_tuple_c, StaticTuple_New, \
 
124
    StaticTuple_Intern, StaticTuple_SET_ITEM, StaticTuple_CheckExact, \
 
125
    StaticTuple_GET_SIZE
 
126
 
 
127
import_static_tuple_c()
121
128
 
122
129
cdef void* _my_memrchr(void *s, int c, size_t n): # cannot_raise
123
130
    # memrchr seems to be a GNU extension, so we have to implement it ourselves
650
657
        # Build up the key that will be used.
651
658
        # By using <object>(void *) Pyrex will automatically handle the
652
659
        # Py_INCREF that we need.
653
 
        path_name_file_id_key = (<object>p_current_dirname[0],
 
660
        path_name_file_id_key = StaticTuple(<object>p_current_dirname[0],
654
661
                                 self.get_next_str(),
655
662
                                 self.get_next_str(),
656
663
                                )
677
684
            executable_cstr = self.get_next(&cur_size)
678
685
            is_executable = (executable_cstr[0] == c'y')
679
686
            info = self.get_next_str()
680
 
            PyList_Append(trees, (
 
687
            PyList_Append(trees, StaticTuple(
681
688
                minikind,     # minikind
682
689
                fingerprint,  # fingerprint
683
690
                entry_size,   # size