Run all performance demonstrations.
()
| 321 | |
| 322 | |
| 323 | def main(): |
| 324 | """Run all performance demonstrations.""" |
| 325 | print("🚀 B+ Tree Performance Demonstration 🚀\n") |
| 326 | print("This benchmark shows where B+ Tree excels compared to alternatives.\n") |
| 327 | |
| 328 | benchmark_range_queries() |
| 329 | benchmark_iteration() |
| 330 | benchmark_insertion() |
| 331 | demonstrate_early_termination() |
| 332 | capacity_tuning_demo() |
| 333 | benchmark_memory_usage() |
| 334 | |
| 335 | print("=== Performance Summary ===") |
| 336 | print("B+ Tree is FASTER than dict/SortedDict for:") |
| 337 | print("✓ Range queries (especially partial ranges)") |
| 338 | print("✓ Ordered iteration") |
| 339 | print("✓ Early termination scenarios") |
| 340 | print("✓ Large dataset operations") |
| 341 | print() |
| 342 | print("B+ Tree may be SLOWER for:") |
| 343 | print("• Random single-key lookups") |
| 344 | print("• Small datasets (< 1000 items)") |
| 345 | print("• Insertion-heavy workloads") |
| 346 | print() |
| 347 | print("Choose B+ Tree when you need fast, ordered access to ranges of data!") |
| 348 | |
| 349 | |
| 350 | if __name__ == "__main__": |
no test coverage detected