MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / test_baseline_performance

Function test_baseline_performance

python/tests/test_performance_baseline.py:131–158  ·  view source on GitHub ↗

Test to establish baseline performance metrics.

()

Source from the content-addressed store, hash-verified

129
130
131def test_baseline_performance():
132 """Test to establish baseline performance metrics."""
133 print("Establishing B+ Tree Performance Baseline")
134 print("=" * 50)
135
136 # Test with different tree sizes
137 sizes = [1000, 10000, 100000]
138
139 for size in sizes:
140 print(f"\nTree Size: {size:,} items")
141 print("-" * 30)
142
143 baseline = PerformanceBaseline(tree_size=size)
144 results = baseline.run_all_tests()
145
146 for test_name, metrics in results.items():
147 print(f"\n{test_name.replace('_', ' ').title()}:")
148 for metric, value in metrics.items():
149 if "per_second" in metric:
150 print(f" {metric}: {value:,.0f}")
151 elif "ns" in metric:
152 print(f" {metric}: {value:.1f}")
153 else:
154 print(f" {metric}: {value:.4f}s")
155
156 # Save baseline for comparison
157 print("\n" + "=" * 50)
158 print("Baseline established. Use these metrics to measure optimization impact.")
159
160
161if __name__ == "__main__":

Callers 1

Calls 3

run_all_testsMethod · 0.95
PerformanceBaselineClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected