Perf tests

This commit is contained in:
Jeffrey A. Clark 2026-02-05 18:01:09 -05:00
parent 72e509ac33
commit 53b6fba0cf
3 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ functions:
binary: bash
args:
- -c
- "if [ -f .evergreen/scripts/env.sh ]; then . .evergreen/scripts/env.sh; fi; if [ \"Windows_NT\" = \"${OS:-}\" ]; then CARGO_BIN=\"$USERPROFILE/.cargo/bin\"; else CARGO_BIN=\"$HOME/.cargo/bin\"; fi; export PATH=\"$CARGO_BIN:$PATH\"; if ! command -v cargo &> /dev/null; then echo \"Installing Rust...\"; curl --proto \"=https\" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; if [ -f \"$HOME/.cargo/env\" ]; then . \"$HOME/.cargo/env\"; fi; fi; if command -v cargo &> /dev/null && ! command -v maturin &> /dev/null; then echo \"Installing maturin...\"; pip install maturin; fi; echo \"Rust toolchain: $(rustc --version 2>/dev/null || echo not found)\"; echo \"Cargo: $(cargo --version 2>/dev/null || echo not found)\"; echo \"Maturin: $(maturin --version 2>/dev/null || echo not found)\"; if [ -f .evergreen/scripts/env.sh ]; then echo \"export PATH=\\\"$CARGO_BIN:\\$PATH\\\"\" >> .evergreen/scripts/env.sh; fi; bash .evergreen/just.sh setup-tests perf \"\"; export FASTBENCH=1; bash .evergreen/just.sh run-tests TestRustSimpleIntEncodingC TestRustSimpleIntEncodingRust TestRustMixedTypesEncodingC TestRustMixedTypesEncodingRust TestRustSimpleIntDecodingC TestRustSimpleIntDecodingRust TestRustNestedEncodingC TestRustNestedEncodingRust TestRustListEncodingC TestRustListEncodingRust"
- "if [ -f .evergreen/scripts/env.sh ]; then . .evergreen/scripts/env.sh; fi; if [ \"Windows_NT\" = \"${OS:-}\" ]; then CARGO_BIN=\"$USERPROFILE/.cargo/bin\"; else CARGO_BIN=\"$HOME/.cargo/bin\"; fi; export PATH=\"$CARGO_BIN:$PATH\"; if ! command -v cargo &> /dev/null; then echo \"Installing Rust...\"; curl --proto \"=https\" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; if [ -f \"$HOME/.cargo/env\" ]; then . \"$HOME/.cargo/env\"; fi; fi; if command -v cargo &> /dev/null && ! command -v maturin &> /dev/null; then echo \"Installing maturin...\"; pip install maturin; fi; echo \"Rust toolchain: $(rustc --version 2>/dev/null || echo not found)\"; echo \"Cargo: $(cargo --version 2>/dev/null || echo not found)\"; echo \"Maturin: $(maturin --version 2>/dev/null || echo not found)\"; if [ -f .evergreen/scripts/env.sh ]; then echo \"export PATH=\\\"$CARGO_BIN:\\$PATH\\\"\" >> .evergreen/scripts/env.sh; fi; bash .evergreen/just.sh setup-tests perf rust; export FASTBENCH=1; bash .evergreen/just.sh run-tests TestRustSimpleIntEncodingC TestRustSimpleIntEncodingRust TestRustMixedTypesEncodingC TestRustMixedTypesEncodingRust TestRustSimpleIntDecodingC TestRustSimpleIntDecodingRust TestRustNestedEncodingC TestRustNestedEncodingRust TestRustListEncodingC TestRustListEncodingRust"
working_dir: src
include_expansions_in_env:
- PYMONGO_BUILD_RUST

View File

@ -1454,7 +1454,7 @@ def create_perf_rust_func():
'echo "export PATH=\\"$CARGO_BIN:\\$PATH\\"" >> .evergreen/scripts/env.sh; '
"fi; "
# Set up the test environment with perf extras
'bash .evergreen/just.sh setup-tests perf ""; '
"bash .evergreen/just.sh setup-tests perf rust; "
# Run the Rust-specific performance benchmarks
# These tests compare C vs Rust BSON encoding/decoding performance
"export FASTBENCH=1; "

View File

@ -449,7 +449,7 @@ def handle_test_env() -> None:
# PYTHON-4769 Run perf_test.py directly otherwise pytest's test collection negatively
# affects the benchmark results.
if sub_test_name == "sync":
if sub_test_name == "sync" or sub_test_name == "rust":
TEST_ARGS = f"test/performance/perf_test.py {TEST_ARGS}"
else:
TEST_ARGS = f"test/performance/async_perf_test.py {TEST_ARGS}"