Merge lp:~spiv/bzr/c-extension-regression into lp:~bzr/bzr/trunk-old

Proposed by Andrew Bennetts
Status: Merged
Merged at revision: not available
Proposed branch: lp:~spiv/bzr/c-extension-regression
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 68 lines
To merge this branch: bzr merge lp:~spiv/bzr/c-extension-regression
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+9357@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Andrew Bennetts (spiv) wrote :

This fixes imports of _knit_load_data_pyx, which weren't updated when the
extension got renamed. We really should make a 1.17.1 with this fix, I think.

It's a bit embarrassing that we didn't notice this before the 1.17 release, but
hopefully now that the C and Pyrex extensions have consistent names this will be
less likely to happen in future.

-Andrew.

Revision history for this message
Andrew Bennetts (spiv) wrote :

Btw, I've gone ahead and submitted this to bzr.dev, it does seem clearly correct to me, so I decided it wasn't necessary to wait for review.

Revision history for this message
Martin Pool (mbp) wrote :

> Btw, I've gone ahead and submitted this to bzr.dev, it does seem clearly
> correct to me, so I decided it wasn't necessary to wait for review.

It looks ok to me too.

It's interesting to contemplate how this bug could have been prevented though, because there is definitely a test launcae here.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2009-07-27 05:24:02 +0000
3+++ NEWS 2009-07-28 08:35:14 +0000
4@@ -78,6 +78,10 @@
5 lots of backtraces about ``UnknownSmartMethod``, ``do_chunk`` or
6 ``do_end``. (Andrew Bennetts, #338561)
7
8+* The optional ``_knit_load_data_pyx`` C extension was never being
9+ imported. This caused significant slowdowns when reading data from
10+ repositories. (Andrew Bennetts, #405653)
11+
12 * There was a bug in ``osutils.relpath`` that was only triggered on
13 Windows. Essentially if you were at the root of a drive, and did
14 something to a branch/repo on another drive, we would go into an
15
16=== modified file 'bzrlib/benchmarks/bench_knit.py'
17--- bzrlib/benchmarks/bench_knit.py 2009-03-23 14:59:43 +0000
18+++ bzrlib/benchmarks/bench_knit.py 2009-07-28 08:35:14 +0000
19@@ -65,7 +65,7 @@
20 def reset():
21 knit._load_data = orig
22 self.addCleanup(reset)
23- from bzrlib._knit_load_data_c import _load_data_c
24+ from bzrlib._knit_load_data_pyx import _load_data_c
25 knit._load_data = _load_data_c
26
27 def setup_load_data_py(self):
28
29=== modified file 'bzrlib/knit.py'
30--- bzrlib/knit.py 2009-07-15 17:51:40 +0000
31+++ bzrlib/knit.py 2009-07-28 08:35:14 +0000
32@@ -3621,6 +3621,6 @@
33 to_process.extend(self._process_pending(key))
34
35 try:
36- from bzrlib._knit_load_data_c import _load_data_c as _load_data
37+ from bzrlib._knit_load_data_pyx import _load_data_c as _load_data
38 except ImportError:
39 from bzrlib._knit_load_data_py import _load_data_py as _load_data
40
41=== modified file 'bzrlib/tests/test_knit.py'
42--- bzrlib/tests/test_knit.py 2009-07-24 19:22:25 +0000
43+++ bzrlib/tests/test_knit.py 2009-07-28 08:35:14 +0000
44@@ -73,13 +73,13 @@
45
46 def _probe(self):
47 try:
48- import bzrlib._knit_load_data_c
49+ import bzrlib._knit_load_data_pyx
50 except ImportError:
51 return False
52 return True
53
54 def feature_name(self):
55- return 'bzrlib._knit_load_data_c'
56+ return 'bzrlib._knit_load_data_pyx'
57
58 CompiledKnitFeature = _CompiledKnitFeature()
59
60@@ -1316,7 +1316,7 @@
61 def reset():
62 knit._load_data = orig
63 self.addCleanup(reset)
64- from bzrlib._knit_load_data_c import _load_data_c
65+ from bzrlib._knit_load_data_pyx import _load_data_c
66 knit._load_data = _load_data_c
67 allow_writes = lambda: mode == 'w'
68 return _KndxIndex(transport, mapper, lambda:None, allow_writes, lambda:True)