Skip to content

Commit 50b86fb

Browse files
committed
Remove benchmark_bson.py and clarify Rust testing in perf_test.py
The benchmark_bson.py script was redundant with the existing Rust comparison tests in perf_test.py. Updated README to clarify that Rust vs C benchmarking happens in perf_test.py with dedicated test classes: - TestRustSimpleIntEncoding[C|Rust] - TestRustSimpleIntDecoding[C|Rust] - TestRustMixedTypesEncoding[C|Rust] - TestRustNestedEncoding[C|Rust] - TestRustListEncoding[C|Rust] This provides a cleaner, more maintainable approach with all performance tests in one place.
1 parent 5ec36dc commit 50b86fb

2 files changed

Lines changed: 15 additions & 300 deletions

File tree

README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -559,28 +559,27 @@ PYMONGO_USE_RUST=1 pytest test/test_bson.py -v
559559

560560
**Benchmark BSON performance:**
561561

562-
A focused BSON benchmark script is available at `test/performance/benchmark_bson.py`:
562+
The performance test suite at `test/performance/perf_test.py` includes Rust vs C comparison benchmarks:
563563

564564
```bash
565-
# Compare C vs Rust extensions (default)
566-
python test/performance/benchmark_bson.py
565+
# Run all performance tests (includes BSON micro-benchmarks with C vs Rust comparison)
566+
FASTBENCH=1 python test/performance/perf_test.py -v
567567

568-
# Quick test with fewer iterations
569-
python test/performance/benchmark_bson.py --quick
568+
# Run only Rust comparison tests
569+
FASTBENCH=1 python test/performance/perf_test.py -v -k Rust
570570

571-
# Verbose output
572-
python test/performance/benchmark_bson.py -v
573-
574-
# Test only C extension
575-
python test/performance/benchmark_bson.py --c-only
576-
577-
# Test only Rust extension
578-
python test/performance/benchmark_bson.py --rust-only
571+
# Run specific Rust comparison tests
572+
FASTBENCH=1 python test/performance/perf_test.py -v TestRustSimpleIntEncodingC TestRustSimpleIntEncodingRust
579573
```
580574

581-
**Difference from perf_test.py:**
582-
- `benchmark_bson.py`: Focused BSON encoding/decoding benchmarks only (no database, just serialization)
583-
- `perf_test.py`: Full MongoDB driver performance suite (includes network, database operations, BSON, etc.)
575+
**Rust comparison tests in perf_test.py:**
576+
- `TestRustSimpleIntEncoding[C|Rust]` - Simple integer document encoding
577+
- `TestRustSimpleIntDecoding[C|Rust]` - Simple integer document decoding
578+
- `TestRustMixedTypesEncoding[C|Rust]` - Mixed types (string, int, float, bool, null)
579+
- `TestRustNestedEncoding[C|Rust]` - Nested document encoding
580+
- `TestRustListEncoding[C|Rust]` - List encoding
581+
582+
Each test has both a C and Rust variant for direct comparison. The test suite also includes standard BSON micro-benchmarks (flat, deep, full) and full MongoDB driver benchmarks.
584583

585584
### Technical Details
586585

test/performance/benchmark_bson.py

Lines changed: 0 additions & 284 deletions
This file was deleted.

0 commit comments

Comments
 (0)