Skip to content

Comments

perf(no-unnecessary-type-arguments): use isTypeIdenticalTo + flags checks#723

Merged
camc314 merged 3 commits intooxc-project:mainfrom
RTVision:fix/no-unnecessary-type-arguments-perf-issue
Feb 22, 2026
Merged

perf(no-unnecessary-type-arguments): use isTypeIdenticalTo + flags checks#723
camc314 merged 3 commits intooxc-project:mainfrom
RTVision:fix/no-unnecessary-type-arguments-perf-issue

Conversation

@kalvenschraut
Copy link
Contributor

@kalvenschraut kalvenschraut commented Feb 22, 2026

AI wrote this when trying to find why a rule was so slow against my company's internal codebase.
Before these changes
image

after

image

@kalvenschraut kalvenschraut changed the title perf: add more checks to avoid expensive function calls when not needed perf: replace isTypeStrictSubtypeOf shim with isTypeStrictSubtypeOf and check flags to try minimize more expensive checks Feb 22, 2026
Copy link
Member

@camchenry camchenry left a comment

Choose a reason for hiding this comment

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

I think this makes sense: checking A < B and B < A should be the same as checking A == B, and that seems to correspond with the ts-eslint rule behavior too (i.e., doesn't report this rule even if the arg type is a subtype of the param type).

@no-yan
Copy link
Collaborator

no-yan commented Feb 22, 2026

Wonderful!

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

nice!

@camc314 camc314 enabled auto-merge (squash) February 22, 2026 14:25
@camc314 camc314 disabled auto-merge February 22, 2026 14:26
@camc314 camc314 changed the title perf: replace isTypeStrictSubtypeOf shim with isTypeStrictSubtypeOf and check flags to try minimize more expensive checks perf: replace isTypeStrictSubtypeOf shim with isTypeStrictSubtypeOf and check flags Feb 22, 2026
@camc314 camc314 changed the title perf: replace isTypeStrictSubtypeOf shim with isTypeStrictSubtypeOf and check flags perf(no-unnecessary-type-arguments): use isTypeStrictSubtypeOf + flags checks Feb 22, 2026
@camc314 camc314 changed the title perf(no-unnecessary-type-arguments): use isTypeStrictSubtypeOf + flags checks perf(no-unnecessary-type-arguments): use isTypeIdenticalTo + flags checks Feb 22, 2026
@camc314 camc314 enabled auto-merge (squash) February 22, 2026 14:28
@camc314 camc314 merged commit e120124 into oxc-project:main Feb 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants