mirror of
https://github.com/astral-sh/ruff.git
synced 2026-12-04 02:03:58 +08:00
Update the CodSpeed benchmark harnesses and runner (#30323)
## Summary We see cases where the codspeed result differs based on the order in which the benchmarks run, because they all run in the same process (and use the same allocator). Newer codspeed versions run each benchmark in a separate process, protecting them from "warm allocator" effects. This PR updates `cargo-codspeed` to 6.0.0 and the CodSpeed action to 5.6.3. Each simulated Criterion or Divan benchmark now starts in a fresh process, so allocations in one fixture can no longer change the instruction count of the next. ## Test Plan Verified that the linter fixture and all four module-resolution inputs each ran in a separate process, and that the updated dependencies meet the seven-day cooldown.
This commit is contained in:
@@ -1456,7 +1456,7 @@ jobs:
|
||||
| sudo tee /etc/apt/apt.conf.d/80-retries > /dev/null
|
||||
|
||||
- name: "Run benchmarks"
|
||||
uses: CodSpeedHQ/action@f842b9a3ffe213dbb81768fd7f7eeb4dfcf1c369 # v5.4.2
|
||||
uses: CodSpeedHQ/action@af75f77f17a054769abefaa42fe8dc2975469b5f # v5.6.3
|
||||
with:
|
||||
mode: "simulation,memory"
|
||||
run: uv run --only-dev cargo codspeed run
|
||||
@@ -1582,7 +1582,7 @@ jobs:
|
||||
| sudo tee /etc/apt/apt.conf.d/80-retries > /dev/null
|
||||
|
||||
- name: "Run benchmarks"
|
||||
uses: CodSpeedHQ/action@f842b9a3ffe213dbb81768fd7f7eeb4dfcf1c369 # v5.4.2
|
||||
uses: CodSpeedHQ/action@af75f77f17a054769abefaa42fe8dc2975469b5f # v5.6.3
|
||||
with:
|
||||
mode: ${{ matrix.mode }}
|
||||
disable-memory-capture-stack: true
|
||||
@@ -1659,7 +1659,7 @@ jobs:
|
||||
run: find target/codspeed -type f -exec chmod +x {} +
|
||||
|
||||
- name: "Run benchmarks"
|
||||
uses: CodSpeedHQ/action@f842b9a3ffe213dbb81768fd7f7eeb4dfcf1c369 # v5.4.2
|
||||
uses: CodSpeedHQ/action@af75f77f17a054769abefaa42fe8dc2975469b5f # v5.6.3
|
||||
env:
|
||||
CODSPEED_PERF_ENABLED: false
|
||||
CODSPEED_DISABLE_MEMORY_CAPTURE_STACK: true
|
||||
@@ -1741,7 +1741,7 @@ jobs:
|
||||
run: find target/codspeed -type f -exec chmod +x {} +
|
||||
|
||||
- name: "Run benchmarks"
|
||||
uses: CodSpeedHQ/action@f842b9a3ffe213dbb81768fd7f7eeb4dfcf1c369 # v5.4.2
|
||||
uses: CodSpeedHQ/action@af75f77f17a054769abefaa42fe8dc2975469b5f # v5.6.3
|
||||
env:
|
||||
# enabling walltime flamegraphs adds ~6 minutes to the CI time, and they don't
|
||||
# appear to provide much useful insight for our walltime benchmarks right now
|
||||
|
||||
Generated
+12
-13
@@ -578,16 +578,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "codspeed"
|
||||
version = "5.0.1"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7083f253260bcb4aaa3b4aa4c52973703dabc1a85c2f193997e2689aafa8a919"
|
||||
checksum = "7e7c21807b937b8e535f2745cd83c525fc250524021cd662b9ba4d3e399bb504"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cc",
|
||||
"colored",
|
||||
"getrandom 0.4.2",
|
||||
"glob",
|
||||
"libc",
|
||||
"nix",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -596,9 +595,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "codspeed-criterion-compat"
|
||||
version = "5.0.1"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d9f24251445188c69d50f10179d795424bd71b533b7e3f84fc03f26893b01af0"
|
||||
checksum = "8a14939cf9e46182bdfbf6de618a8a110361c15a27eccff8f5ad4380249e9c14"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"codspeed",
|
||||
@@ -609,9 +608,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "codspeed-criterion-compat-walltime"
|
||||
version = "5.0.1"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c38205d56e2cb4fe04b708de7f9653a3f1b89edbe3a20b28f21e9e525e9e061"
|
||||
checksum = "af785573a72d17af663e661a45e1d617a2bab9f3a13a219ca0ae6ef9412ea1d8"
|
||||
dependencies = [
|
||||
"anes",
|
||||
"cast",
|
||||
@@ -634,9 +633,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "codspeed-divan-compat"
|
||||
version = "5.0.1"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc1065d507e1cbab731a7976db4cef7e47e49b87b4dbc0a925df07d343558420"
|
||||
checksum = "cc7e48c4e555e60b894144b14df1e893a7317b9f4000b1492ace3041479b12cc"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"codspeed",
|
||||
@@ -647,9 +646,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "codspeed-divan-compat-macros"
|
||||
version = "5.0.1"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2fd05482a95823ffe421e8a9ba24fa22a6a30d594e2c60455cbb43a41bf2d8fa"
|
||||
checksum = "1eb62a7a8d4cc6b79b18dcbac670b3202f4c8c901ca8ea701ab42190f0b14799"
|
||||
dependencies = [
|
||||
"divan-macros",
|
||||
"itertools 0.14.0",
|
||||
@@ -661,9 +660,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "codspeed-divan-compat-walltime"
|
||||
version = "5.0.1"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d2f8eae75b8fa85357020a404899c4280d590c9fd1c47640b3ce53106c62d2ee"
|
||||
checksum = "15c4e77a97571b6214b976cee7e2a564215d0a5bee9520a3cdab86106d0b31a3"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"clap",
|
||||
|
||||
+2
-2
@@ -93,7 +93,7 @@ clap = { version = "4.5.3", default-features = false, features = [
|
||||
] }
|
||||
clap_complete_command = { version = "0.6.0", default-features = false, features = ["nushell"] }
|
||||
clearscreen = { version = "5.0.0", default-features = false }
|
||||
codspeed-criterion-compat = { version = "5.0.0", default-features = false }
|
||||
codspeed-criterion-compat = { version = "6.0.0", default-features = false }
|
||||
colored = { version = "3.0.0", default-features = false }
|
||||
compact_str = { version = "0.10.0", default-features = false, features = ["std"] }
|
||||
console = { version = "0.16.4", default-features = false, features = ["std"] }
|
||||
@@ -106,7 +106,7 @@ csv = { version = "1.3.1", default-features = false }
|
||||
ctrlc = { version = "3.4.4", default-features = false }
|
||||
dashmap = { version = "6.0.1", default-features = false }
|
||||
datatest-stable = { version = "0.3.3", default-features = false }
|
||||
divan = { package = "codspeed-divan-compat", version = "5.0.0", default-features = false }
|
||||
divan = { package = "codspeed-divan-compat", version = "6.0.0", default-features = false }
|
||||
drop_bomb = { version = "0.1.5", default-features = false }
|
||||
dunce = { version = "1.0.5", default-features = false }
|
||||
etcetera = { version = "0.11.0", default-features = false }
|
||||
|
||||
+2
-2
@@ -59,7 +59,7 @@ exclude = [
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
{ include-group = "jaq" },
|
||||
"astral-dev-toolchain-cargo-codspeed>=5.0.1",
|
||||
"astral-dev-toolchain-cargo-codspeed>=6.0.0",
|
||||
"astral-dev-toolchain-cargo-deny>=0.20.2",
|
||||
"astral-dev-toolchain-cargo-fuzz>=0.13.2",
|
||||
"astral-dev-toolchain-cargo-insta>=1.48.0",
|
||||
@@ -229,7 +229,7 @@ exclude-newer = "P7D"
|
||||
astral-dev-toolchain-cargo-deny = "2026-09-15T19:10:00Z"
|
||||
astral-dev-toolchain-hyperfine = "2026-10-08T08:11:00Z"
|
||||
astral-dev-toolchain-cargo-shear = "2026-08-27T00:00:00Z"
|
||||
astral-dev-toolchain-cargo-codspeed = "2026-08-27T00:00:00Z"
|
||||
astral-dev-toolchain-cargo-codspeed = "2026-10-30T18:01:00Z"
|
||||
astral-dev-toolchain-cargo-nextest = "2026-08-27T00:00:00Z"
|
||||
astral-dev-toolchain-cargo-insta = "2026-08-27T00:00:00Z"
|
||||
astral-dev-toolchain-cargo-fuzz = "2026-09-01T00:00:00Z"
|
||||
|
||||
@@ -14,7 +14,7 @@ exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for
|
||||
exclude-newer-span = "P7D"
|
||||
|
||||
[options.exclude-newer-package]
|
||||
astral-dev-toolchain-cargo-codspeed = "2026-08-27T00:00:00Z"
|
||||
astral-dev-toolchain-cargo-codspeed = "2026-10-30T18:01:00Z"
|
||||
astral-dev-toolchain-cargo-deny = "2026-09-15T19:10:00Z"
|
||||
astral-dev-toolchain-cargo-fuzz = "2026-09-01T00:00:00Z"
|
||||
astral-dev-toolchain-cargo-insta = "2026-08-27T00:00:00Z"
|
||||
@@ -81,15 +81,15 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "astral-dev-toolchain-cargo-codspeed"
|
||||
version = "5.0.1"
|
||||
version = "6.0.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/69/0e/a7d82d3b80efb376676ad9e08b8d5b397fd2993fe436a012d116480edfe0/astral_dev_toolchain_cargo_codspeed-5.0.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:dd304fbc053073e6e8e1b68283d36731788908ce49599e7680582cd87864f11b", size = 962023, upload-time = "2026-08-25T22:20:29.839Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/18/1c/a972d08a06e2646a3642a398a607608510a1ca8e3fae8c609806d783dbd7/astral_dev_toolchain_cargo_codspeed-5.0.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4e04158926ee6c6ff6cdaaa6df46c05d7855e00b5b0c1550a747772cdcdc60c2", size = 941050, upload-time = "2026-08-25T22:20:31.607Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d8/86/e803608dbe08ba83a2361dc21fa4f97c7c6b5e84a478637ddd9269aacb2d/astral_dev_toolchain_cargo_codspeed-5.0.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e7196c632bb0103ebbf60a75ab076677ad03038fe92a88cbe27b1eb56e63d2b", size = 871539, upload-time = "2026-08-25T22:20:33.397Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/23/11/fb3246e194a1699f2a4493ba9501da8d65d3f49074330cce4244e3ded8c7/astral_dev_toolchain_cargo_codspeed-5.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15e1005b0a7e4eb750172f2d3d7c6ccb3e78e9b55fa4bcd62f54350181dca6a1", size = 922701, upload-time = "2026-08-25T22:20:34.902Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c1/d9/bfb2f45e36c1525f0c9810405f605f39d7c8b4dcf250629b141b89eb89e6/astral_dev_toolchain_cargo_codspeed-5.0.1-py3-none-win_amd64.whl", hash = "sha256:ac995814067402b6604c6d8d9ab76700288f015494c53c4e75da09d5bc2ee5f7", size = 824114, upload-time = "2026-08-25T22:20:36.338Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ce/34/cc139216c71c1bcb67c1623420843646a36748b7ab13d3ae502b5fdbb84d/astral_dev_toolchain_cargo_codspeed-5.0.1-py3-none-win_arm64.whl", hash = "sha256:4bb1b696762454f924a85e0949ab8da1e788124683b644d3b997115d61455700", size = 783231, upload-time = "2026-08-25T22:20:37.889Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/74/b3/80c51b078540b8661cb1f5a39e5f95e111960cb0df3d52a9bdf43f244ea5/astral_dev_toolchain_cargo_codspeed-6.0.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7c8909cc0d667e7b7dff0b3f80462cb08dcc1fe865a4c3ece55a5b16ef991eef", size = 964749, upload-time = "2026-10-30T18:00:42.596Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/aa/cc/67577c3d8085fc84fae345c772ecc1b007b0b367d7637c58d52eacb5f4f4/astral_dev_toolchain_cargo_codspeed-6.0.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7072ef5528ccf4629cef1bd02e3115505fb047bc96e229fdd799f6eb21609452", size = 941771, upload-time = "2026-10-30T18:00:44.344Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ac/62/b370ff6c36ca80a421ab9cfa87630b2d62b64de43924c0485f78450ba712/astral_dev_toolchain_cargo_codspeed-6.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:86771cc538d3f999c9bf8507fbd6023705110d0b2cb54aa9df40b7d94a6f6c6f", size = 875659, upload-time = "2026-10-30T18:00:45.729Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e4/b9/bf706c985d8fdef9ebab92624822acc72272f9f8141e71d02840e7473d94/astral_dev_toolchain_cargo_codspeed-6.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eee9a3a1180fe54fa263556b1447f6df721f4e60b786468cade0075f9ed0f6d6", size = 920562, upload-time = "2026-10-30T18:00:47.101Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a4/09/09bb56d3a29d5d8689db01a6fa61e1556ce407608f7712cef76198caf362/astral_dev_toolchain_cargo_codspeed-6.0.0-py3-none-win_amd64.whl", hash = "sha256:a108a412a4c7e463042c4621f195799cb385f67b4e8f741b31c0c0b66cc50fb1", size = 818031, upload-time = "2026-10-30T18:00:48.404Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/fa/7e287b82940ea85562e3b03c94f1665f0d02649f76250694f4a866e565cc/astral_dev_toolchain_cargo_codspeed-6.0.0-py3-none-win_arm64.whl", hash = "sha256:30c2963e45ba4d6c75cc8b817b5c0c238aa3911d339e2f99d092036458d8c931", size = 777940, upload-time = "2026-10-30T18:00:49.753Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1619,7 +1619,7 @@ typeshed-formatting = ">=3.10"
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "astral-dev-toolchain-cargo-codspeed", marker = "python_full_version >= '3.12'", specifier = ">=5.0.1" },
|
||||
{ name = "astral-dev-toolchain-cargo-codspeed", marker = "python_full_version >= '3.12'", specifier = ">=6.0.0" },
|
||||
{ name = "astral-dev-toolchain-cargo-deny", marker = "python_full_version >= '3.12'", specifier = ">=0.20.2" },
|
||||
{ name = "astral-dev-toolchain-cargo-fuzz", marker = "python_full_version >= '3.12'", specifier = ">=0.13.2" },
|
||||
{ name = "astral-dev-toolchain-cargo-insta", marker = "python_full_version >= '3.12'", specifier = ">=1.48.0" },
|
||||
|
||||
Reference in New Issue
Block a user