Rev 2538: Fix dirstate benchmarks for new layout. in http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/dirstate_pyrex
John Arbash Meinel
john at arbash-meinel.com
Thu Jul 12 06:20:41 BST 2007
At http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/dirstate_pyrex
------------------------------------------------------------
revno: 2538
revision-id: john at arbash-meinel.com-20070712051503-ntboo0z3prcrcg3t
parent: john at arbash-meinel.com-20070712051426-u9auufylv5cba940
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate_pyrex
timestamp: Thu 2007-07-12 00:15:03 -0500
message:
Fix dirstate benchmarks for new layout.
modified:
bzrlib/benchmarks/bench_dirstate.py bench_dirstate.py-20070503203500-gs0pz6zkvjpq9l2x-1
-------------- next part --------------
=== modified file 'bzrlib/benchmarks/bench_dirstate.py'
--- a/bzrlib/benchmarks/bench_dirstate.py 2007-05-07 21:42:33 +0000
+++ b/bzrlib/benchmarks/bench_dirstate.py 2007-07-12 05:15:03 +0000
@@ -25,7 +25,7 @@
osutils,
tests,
)
-from bzrlib.tests.compiled.test_dirstate_helpers import (
+from bzrlib.tests.test__dirstate_helpers import (
CompiledDirstateHelpersFeature,
)
@@ -194,19 +194,20 @@
state.unlock()
def test__read_dirblocks_20k_tree_0_parents_py(self):
+ from bzrlib._dirstate_helpers_py import _read_dirblocks_py
state = self.build_20k_dirstate()
state.lock_read()
try:
self.assertEqual(dirstate.DirState.NOT_IN_MEMORY,
state._dirblock_state)
state._read_header_if_needed()
- self.time(dirstate._read_dirblocks_py, state)
+ self.time(_read_dirblocks_py, state)
finally:
state.unlock()
def test__read_dirblocks_20k_tree_0_parents_c(self):
self.requireFeature(CompiledDirstateHelpersFeature)
- from bzrlib.compiled.dirstate_helpers import _read_dirblocks_c
+ from bzrlib._dirstate_helpers_c import _read_dirblocks_c
state = self.build_20k_dirstate()
state.lock_read()
try:
@@ -218,19 +219,20 @@
state.unlock()
def test__read_dirblocks_20k_tree_1_parent_py(self):
+ from bzrlib._dirstate_helpers_py import _read_dirblocks_py
state = self.build_20k_dirstate_with_parents(1)
state.lock_read()
try:
self.assertEqual(dirstate.DirState.NOT_IN_MEMORY,
state._dirblock_state)
state._read_header_if_needed()
- self.time(dirstate._read_dirblocks_py, state)
+ self.time(_read_dirblocks_py, state)
finally:
state.unlock()
def test__read_dirblocks_20k_tree_1_parent_c(self):
self.requireFeature(CompiledDirstateHelpersFeature)
- from bzrlib.compiled.dirstate_helpers import _read_dirblocks_c
+ from bzrlib._dirstate_helpers_c import _read_dirblocks_c
state = self.build_20k_dirstate_with_parents(1)
state.lock_read()
try:
@@ -242,19 +244,20 @@
state.unlock()
def test__read_dirblocks_20k_tree_2_parents_py(self):
+ from bzrlib._dirstate_helpers_py import _read_dirblocks_py
state = self.build_20k_dirstate_with_parents(2)
state.lock_read()
try:
self.assertEqual(dirstate.DirState.NOT_IN_MEMORY,
state._dirblock_state)
state._read_header_if_needed()
- self.time(dirstate._read_dirblocks_py, state)
+ self.time(_read_dirblocks_py, state)
finally:
state.unlock()
def test__read_dirblocks_20k_tree_2_parents_c(self):
self.requireFeature(CompiledDirstateHelpersFeature)
- from bzrlib.compiled.dirstate_helpers import _read_dirblocks_c
+ from bzrlib._dirstate_helpers_c import _read_dirblocks_c
state = self.build_20k_dirstate_with_parents(2)
state.lock_read()
try:
@@ -310,30 +313,32 @@
self.assertEqualDiff(expected_str, offset_str)
def test_bisect_dirblock_py(self):
+ from bzrlib._dirstate_helpers_py import bisect_dirblock_py
state = self.build_10k_dirstate_dirs()
state.lock_read()
try:
self.setup_paths_and_offsets(state)
offsets = self.time(self.do_bisect_list,
- dirstate.bisect_dirblock_py)
+ bisect_dirblock_py)
self.checkOffsets(offsets)
finally:
state.unlock()
def test_bisect_dirblock_cached_py(self):
+ from bzrlib._dirstate_helpers_py import bisect_dirblock_py
state = self.build_10k_dirstate_dirs()
state.lock_read()
try:
self.setup_paths_and_offsets(state)
offsets = self.time(self.do_bisect_list_cached,
- dirstate.bisect_dirblock_py)
+ bisect_dirblock_py)
self.checkOffsets(offsets)
finally:
state.unlock()
def test_bisect_dirblock_c(self):
self.requireFeature(CompiledDirstateHelpersFeature)
- from bzrlib.compiled.dirstate_helpers import bisect_dirblock_c
+ from bzrlib._dirstate_helpers_c import bisect_dirblock_c
state = self.build_10k_dirstate_dirs()
state.lock_read()
try:
@@ -410,11 +415,12 @@
def test_cmp_by_dirs_py(self):
"""Benchmark 103041 comparisons."""
- self.compareAllPaths(dirstate.cmp_by_dirs_py,
+ from bzrlib._dirstate_helpers_py import cmp_by_dirs_py
+ self.compareAllPaths(cmp_by_dirs_py,
[(3, 1), (3, 1), (3, 1), (3, 2)])
def test_cmp_by_dirs_c(self):
self.requireFeature(CompiledDirstateHelpersFeature)
- from bzrlib.compiled.dirstate_helpers import cmp_by_dirs_c
+ from bzrlib._dirstate_helpers_c import cmp_by_dirs_c
self.compareAllPaths(cmp_by_dirs_c,
[(3, 1), (3, 1), (3, 1), (3, 2)])
More information about the bazaar-commits
mailing list