()
| 260 | |
| 261 | # B+ Tree approach |
| 262 | def bplus_early_termination(): |
| 263 | result = [] |
| 264 | for key, value in bplustree.range(40000, None): |
| 265 | result.append((key, value)) |
| 266 | if len(result) >= 10: |
| 267 | break |
| 268 | return result |
| 269 | |
| 270 | bplus_time, bplus_result = benchmark_function(bplus_early_termination) |
| 271 | print(f" B+ Tree: {bplus_time*1000:.3f} ms (found {len(bplus_result)} items)") |