Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve speed of types #1118

Merged
merged 1 commit into from
Jun 5, 2024
Merged

Improve speed of types #1118

merged 1 commit into from
Jun 5, 2024

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Jun 5, 2024

This PR improves the speed of the types. On my machine, they are now ~4 times faster.

Before:

$ time tsc index.d.ts
real	0m5.064s
user	0m7.940s
sys	0m0.339s

After:

$ time tsc index.d.ts
real	0m1.284s
user	0m3.242s
sys	0m0.133s

Also, our type checking task is now roughly twice faster.

What this PR does is removing a few extends constraints. Apparently, some of them were making the types much slower, but were more for safety/documentation purpose, i.e. could be removed without impacting the types. All of those types are internal.

@sindresorhus sindresorhus merged commit 772e136 into main Jun 5, 2024
14 checks passed
@sindresorhus sindresorhus deleted the typescript-speed branch June 5, 2024 08:37
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.

2 participants