From 60f7ec90ef817b57b2a35c097456000443d68f1c Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 5 Jan 2026 14:35:43 -0500 Subject: [PATCH] Add a `fast-test` profile (#22382) ## Summary We use this profile in uv to create success, as an optimization for the iterative test loop. We include `opt-level=1` because it ends up being "worth it" for testing (empirically), even though it means the build is actually a big slower than `dev` (if you remove `opt-level=1`, clean compile is about 22% faster than `dev`). Here are some benchmarks I generated with Claude -- the main motivator here is the incremental testing for `ty_python_semantic` which is 2.4x faster: ### `ty_python_semantic` Full test suite (471 tests): | Scenario | dev | fast-test | Improvement | |-------------|-------|------------|-------------| | Clean | 53s | 49s | 8% faster | | Incremental | 17.8s | 6.8s | 2.4x faster | Single test: | Scenario | dev | fast-test | Improvement | |-------------|-------|------------|-------------| | Clean | 42.5s | 55.3s | 30% slower | | Incremental | 6.5s | 6.1s | ~same | ### `ruff_linter` Full test suite (2622 tests): | Scenario | dev | fast-test | Improvement | |-------------|-------|------------|-------------| | Clean | 31s | 41s | 32% slower | | Incremental | 11.9s | 10.5s | 12% faster | Single test: | Scenario | dev | fast-test | Improvement | |-------------|------|------------|-------------| | Clean | 26s | 36.5s | 40% slower | | Incremental | 4.5s | 5.5s | 22% slower | --- CLAUDE.md | 6 ++++++ Cargo.toml | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 289f3bb944..9ed589bf29 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,6 +10,12 @@ Run all tests (using `nextest` for faster execution): cargo nextest run ``` +For faster test execution, use the `fast-test` profile which enables optimizations while retaining debug info: + +```sh +cargo nextest run --cargo-profile fast-test +``` + Run tests for a specific crate: ```sh diff --git a/Cargo.toml b/Cargo.toml index cca70fbdc6..f96b83f98f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -335,6 +335,11 @@ strip = false debug = "full" lto = false +# Profile for faster iteration: applies minimal optimizations for faster tests. +[profile.fast-test] +inherits = "dev" +opt-level = 1 + # The profile that 'cargo dist' will build with. [profile.dist] inherits = "release"