Skip to content

Don't measure the AST deallocation time in parser benchmarks#24301

Merged
MichaReiser merged 1 commit intomainfrom
micha/parser-benchmark-dealloc
Mar 30, 2026
Merged

Don't measure the AST deallocation time in parser benchmarks#24301
MichaReiser merged 1 commit intomainfrom
micha/parser-benchmark-dealloc

Conversation

@MichaReiser
Copy link
Copy Markdown
Member

Summary

Looking at CodSpeeds memory profiles made me realize that
our parser benchmarks include the AST deallocation time. That's not really what we're interested in.

This PR excludes the deallocation time from what's measured in the benchmarks.

Test Plan

CI

@MichaReiser MichaReiser added the testing Related to testing Ruff itself label Mar 30, 2026
@MichaReiser MichaReiser force-pushed the micha/parser-benchmark-dealloc branch 2 times, most recently from b6252cc to 7c8674b Compare March 30, 2026 09:31
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 30, 2026

Merging this PR will improve performance by 8.05%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 5 improved benchmarks
✅ 102 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation parser[numpy/ctypeslib.py] 964.5 µs 902.5 µs +6.87%
Simulation parser[large/dataset.py] 5.2 ms 4.9 ms +6.04%
Simulation parser[unicode/pypinyin.py] 336.6 µs 314.6 µs +6.99%
Simulation parser[pydantic/types.py] 2 ms 1.9 ms +8.05%
Simulation parser[numpy/globals.py] 111.6 µs 105.4 µs +5.8%

Comparing micha/parser-benchmark-dealloc (1ce7a03) with main (bd477d9)

Open in CodSpeed

Base automatically changed from micha/codspeed-memory to main March 30, 2026 13:32
@MichaReiser MichaReiser force-pushed the micha/parser-benchmark-dealloc branch from 7c8674b to 1ce7a03 Compare March 30, 2026 13:33
@MichaReiser MichaReiser merged commit 1572534 into main Mar 30, 2026
48 checks passed
@MichaReiser MichaReiser deleted the micha/parser-benchmark-dealloc branch March 30, 2026 13:46
carljm added a commit that referenced this pull request Mar 31, 2026
* main: (35 commits)
  Store definition indexes as u32 (#24307)
  Avoid re-using symbol in RUF024 fix (#24316)
  [ty] Add materialization to `Divergent` type (#24255)
  [ty] Make `Divergent` a top-level type variant (#24252)
  [ty] Fix nested global and nonlocal lookups through forwarding scopes (#24279)
  Fetch the cargo-dist binary directly instead of using the installer (#24258)
  [ty] Fix panic on `list[Annotated[()]]` (#24303)
  Don't measure the AST deallocation time in parser benchmarks (#24301)
  Enable CodSpeed's memory benchmarks for simulation benchmarks (#24298)
  Upgrade imara-diff to 0.2.0 (#24299)
  [ty] Represent `InitVar` as a special form internally, not a class (#24248)
  `RUF067`: Allow dunder-named assignments in non-strict mode
  [`pyupgrade`] UP018 should detect more unnecessarily wrapped literals (UP018) (#24093)
  [ty] Remove unused `system.glob` method (#24300)
  [ty] Reject functional TypedDict with mismatched name (#24295)
  Update Rust crate arc-swap to v1.9.0 (#24292)
  [ty] Remove unused `@Todo(Functional TypedDicts)` (#24297)
  Update CodSpeedHQ/action action to v4.12.1 (#24290)
  Update taiki-e/install-action action to v2.69.6 (#24293)
  Update Rust crate toml to v1.0.7 (#24289)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant