Skip to content

perf(parser): add Modifiers::contains_accessibility#20832

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-29-perf_parser_add_modifiers_contains_accessibility_
Mar 29, 2026
Merged

perf(parser): add Modifiers::contains_accessibility#20832
graphite-app[bot] merged 1 commit intomainfrom
om/03-29-perf_parser_add_modifiers_contains_accessibility_

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Mar 29, 2026

Add Modifiers::contains_accessibility method.

modifiers.contains_accessibility() is cheaper than modifiers.accessibility().is_some(). This shaves a few instructions off parse_formal_parameter_with_decorators.

Copy link
Copy Markdown
Member Author

overlookmotel commented Mar 29, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Mar 29, 2026
@overlookmotel overlookmotel force-pushed the om/03-29-perf_parser_add_modifiers_contains_accessibility_ branch from 3eca773 to dc3967f Compare March 29, 2026 01:12
@overlookmotel overlookmotel force-pushed the om/03-28-perf_parser_make_modifiers_accessibility_branchless branch from 15ed94a to 7ccff49 Compare March 29, 2026 01:12
@overlookmotel overlookmotel force-pushed the om/03-29-perf_parser_add_modifiers_contains_accessibility_ branch from dc3967f to 8176e92 Compare March 29, 2026 01:12
@overlookmotel overlookmotel force-pushed the om/03-28-perf_parser_make_modifiers_accessibility_branchless branch from 7ccff49 to 2cabc70 Compare March 29, 2026 01:12
@overlookmotel overlookmotel marked this pull request as ready for review March 29, 2026 01:14
Copilot AI review requested due to automatic review settings March 29, 2026 01:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a lightweight Modifiers::contains_accessibility helper to avoid the heavier accessibility().is_some() path in a hot parsing branch.

Changes:

  • Add Modifiers::contains_accessibility() based on a bitset intersection check.
  • Use contains_accessibility() in parse_formal_parameter_with_decorators to reduce work in the parameter-property validation path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
crates/oxc_parser/src/modifiers.rs Introduces Modifiers::contains_accessibility() helper.
crates/oxc_parser/src/js/function.rs Switches the parameter-property guard to use contains_accessibility() for a cheaper check.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 29, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing om/03-29-perf_parser_add_modifiers_contains_accessibility_ (2a06835) with om/03-28-perf_parser_make_modifiers_accessibility_branchless (5995339)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 29, 2026
Copy link
Copy Markdown
Contributor

camc314 commented Mar 29, 2026

Merge activity

  • Mar 29, 3:33 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 29, 3:40 PM UTC: The Graphite merge queue removed this pull request due to removal of a downstack PR #20820.
  • Mar 29, 3:40 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Mar 29, 3:41 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 29, 3:41 PM UTC: The merge label '0-merge' was removed. This PR will no longer be merged by the Graphite merge queue
  • Mar 29, 3:42 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Mar 29, 4:19 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #20820.
  • Mar 29, 4:47 PM UTC: The merge label '0-merge' was removed. This PR will no longer be merged by the Graphite merge queue
  • Mar 29, 4:48 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 29, 4:52 PM UTC: graphite-app added this pull request to the Graphite merge queue.
  • Mar 29, 4:53 PM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 29, 2026
@graphite-app graphite-app bot force-pushed the om/03-28-perf_parser_make_modifiers_accessibility_branchless branch from 2cabc70 to 2da6b13 Compare March 29, 2026 15:44
graphite-app bot pushed a commit that referenced this pull request Mar 29, 2026
Add `Modifiers::contains_accessibility` method.

`modifiers.contains_accessibility()` is cheaper than `modifiers.accessibility().is_some()`. This shaves a few instructions off `parse_formal_parameter_with_decorators`.
@graphite-app graphite-app bot force-pushed the om/03-29-perf_parser_add_modifiers_contains_accessibility_ branch from 8176e92 to 290d0c4 Compare March 29, 2026 15:45
@graphite-app graphite-app bot force-pushed the om/03-28-perf_parser_make_modifiers_accessibility_branchless branch from 2da6b13 to 5995339 Compare March 29, 2026 16:40
Add `Modifiers::contains_accessibility` method.

`modifiers.contains_accessibility()` is cheaper than `modifiers.accessibility().is_some()`. This shaves a few instructions off `parse_formal_parameter_with_decorators`.
@graphite-app graphite-app bot force-pushed the om/03-29-perf_parser_add_modifiers_contains_accessibility_ branch from 290d0c4 to 2a06835 Compare March 29, 2026 16:40
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 29, 2026
Base automatically changed from om/03-28-perf_parser_make_modifiers_accessibility_branchless to main March 29, 2026 16:52
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 29, 2026
@graphite-app graphite-app bot merged commit 2a06835 into main Mar 29, 2026
37 checks passed
@graphite-app graphite-app bot deleted the om/03-29-perf_parser_add_modifiers_contains_accessibility_ branch March 29, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants