|
| 1 | +# Rust Driver Benchmark Suite |
| 2 | + |
| 3 | +This suite implements the benchmarks described in this (spec)[https://github.com/mongodb/specifications/blob/master/source/benchmarking/benchmarking.rst]. |
| 4 | + |
| 5 | +In order to run the microbenchmarks, first run `../etc/microbenchmark-test-data.sh` to download the data. |
| 6 | + |
| 7 | +Note: make sure you run the download script and the microbenchmarks binary from the benchmark root (the directory containing this README). |
| 8 | + |
| 9 | +To execute all benchmarks, run `cargo run --release` with a mongod instance running on port 27017 (or, you can specify a custom |
| 10 | +connection string by setting the `MONGODB_URI` environment variable). You can specify a custom name for the used database or |
| 11 | +collection by setting the `DATABASE_NAME` or `COLL_NAME` environment variables respectively. |
| 12 | + |
| 13 | +Additionally, you can specify custom time frames for the benchmarks by setting the `MAX_EXECUTION_TIME`, `MIN_EXECUTION_TIME` |
| 14 | +and `MAX_ITERATIONS` environment variables. |
| 15 | + |
| 16 | +Run `cargo run --release -- --help` to see a full list of testing options. |
| 17 | + |
| 18 | +When running the benchmarks with the `--ids` flag, you can refer to each benchmark by their unique id. You can refer to multiple |
| 19 | +benchmarks by separating each benchmark's id with a comma. For example `cargo run --release -- --ids 1,2,3,4` would run all |
| 20 | +the single-doc benchmarks. By default, all benchmarks are executed. The table below lists each benchmark's id. |
| 21 | + |
| 22 | +| Benchmark | ID | |
| 23 | +|--------------------------------|----| |
| 24 | +| Run command | 1 | |
| 25 | +| Find one by ID | 2 | |
| 26 | +| Small doc insertOne | 3 | |
| 27 | +| Large doc insertOne | 4 | |
| 28 | +| Find many and empty the cursor | 5 | |
| 29 | +| Small doc bulk insert | 6 | |
| 30 | +| Large doc bulk insert | 7 | |
| 31 | +| LDJSON multi-file import | 8 | |
| 32 | +| LDJSON multi-file export | 9 | |
| 33 | +| All benchmarks | all| |
| 34 | + |
| 35 | +Note that in order to compare against the other drivers, an inMemory mongod instance should be used. |
| 36 | + |
| 37 | +At this point, BSON and GridFS benchmarks are not implemented because we do not own the Rust BSON library, and GridFS has not been implemented |
| 38 | +in the driver. |
| 39 | + |
| 40 | +Also note that the parallel benchmarks are implemented to mirror the C++ driver's interpretation of the spec. |
0 commit comments