From 53b6fba0cfca0f7f009f1cfb775cabdd2c5b15b5 Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Clark" Date: Thu, 5 Feb 2026 18:01:09 -0500 Subject: [PATCH] Perf tests --- .evergreen/generated_configs/functions.yml | 2 +- .evergreen/scripts/generate_config.py | 2 +- .evergreen/scripts/setup_tests.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.evergreen/generated_configs/functions.yml b/.evergreen/generated_configs/functions.yml index 25c94ea70..927baac84 100644 --- a/.evergreen/generated_configs/functions.yml +++ b/.evergreen/generated_configs/functions.yml @@ -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 diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index c5d594b9d..aba89c741 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -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; " diff --git a/.evergreen/scripts/setup_tests.py b/.evergreen/scripts/setup_tests.py index 44233b3dd..da592667d 100644 --- a/.evergreen/scripts/setup_tests.py +++ b/.evergreen/scripts/setup_tests.py @@ -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}"