Skip to content

perf(lint/no-unsafe-enum-assignment): avoid redundant primitive comparisons - #1012

Merged
camc314 merged 1 commit into
oxc-project:mainfrom
camc314:codex/lint-primitive-enum-comparisons
Nov 17, 2026
Merged

camc314 merged 1 commit into
oxc-project:mainfrom
camc314:codex/lint-primitive-enum-comparisons

Conversation

@camc314

@camc314 camc314 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

After checking enum identities, finish comparisons whose constrained types share the same primitive wrapper instead of recursively comparing identical prototype members. Keep structural comparisons for different wrappers and exclude template-literal and string-mapping types from the shortcut. The integration regression covers distinct enums, augmented primitive interfaces and primitive pairs with fast mode and semantic reporting both off/on.

Existing measurements from the original commit, before applying it to current main: Apple M2 Max, identical release helpers with fat LTO, one codegen unit, full symbols, no stripping or PGO, TSRS_FAST=1, and exact frontend requests with all 61 rules and whole-program checking. Hyperfine 2 used warmups and alternating pairs: three at one worker, six at default workers. Counters and wall time cover the helper lifecycle, excluding Oxlint. Benchmarks were not rerun for this PR.

Baseline → candidate medians for the four public lint projects in bench/projects.json:

Project Single-worker instructions (billions) Default-worker instructions (billions) Default-worker wall (s) Default-worker peak RSS (MiB)
webpack 18.351 → 18.220 22.538 → 22.101 0.394 → 0.395 581.5 → 580.0
vscode 194.556 → 187.862 207.026 → 200.519 3.278 → 3.217 3212.1 → 3211.5
mui-docs 37.943 → 38.161 57.900 → 57.346 1.212 → 1.208 1322.6 → 1319.7
t3code-server 66.912 → 65.884 151.158 → 150.440 2.742 → 2.720 2625.4 → 2612.6

Copilot AI balanced review requested due to automatic review settings November 17, 2026 12:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T12:22:49.478254Z e12ab12 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@camc314
camc314 enabled auto-merge November 17, 2026 12:18
@camc314
camc314 added this pull request to the merge queue Nov 17, 2026
Merged via the queue into oxc-project:main with commit 0a310eb Nov 17, 2026
20 checks passed
@camc314
camc314 deleted the codex/lint-primitive-enum-comparisons branch November 17, 2026 12:26
@codspeed

codspeed Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 3.07%

2 warnings

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 1 benchmark with a significant change ran on different hardware

Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

❌ 1 regressed benchmark
✅ 7 untouched benchmarks
⏩ 8 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Memory drizzle-orm 97.9 MB 101 MB -3.07%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing camc314:codex/lint-primitive-enum-comparisons (e12ab12) with main (b26fe50)

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. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants