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

perf: improve type checking performance of BuildMany #286

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

gvergnaud
Copy link
Owner

Performance improvement results

tsc --project tests/tsconfig.json --noEmit --extendedDiagnostics
Category Before After Evolution (%)
Files 206 206 0%
Lines of Library 40,612 40,612 0%
Lines of Definitions 27,266 27,266 0%
Lines of TypeScript 16,129 16,149 0.12%
Lines of JavaScript 0 0 -
Lines of JSON 0 0 -
Lines of Other 0 0 -
Identifiers 121,119 121,150 0.03%
Symbols 854,220 861,962 0.93%
Types 435,316 432,599 -0.65%
Instantiations 6,735,991 4,562,378 -32.33%
Memory used 732,233K 746,454K 1.95%
Assignability cache size 209,959 205,926 -1.92%
Identity cache size 28,093 28,250 0.56%
Subtype cache size 2,944 2,944 0%
Strict subtype cache size 4,628 4,628 0%
I/O Read time 0.01s 0.02s 100%
Parse time 0.21s 0.20s -4.76%
ResolveModule time 0.02s 0.02s 0%
ResolveTypeReference time 0.00s 0.01s -
ResolveLibrary time 0.01s 0.01s 0%
Program time 0.27s 0.27s 0%
Bind time 0.13s 0.13s 0%
Check time 5.78s 4.83s -16.44%
printTime time 0.00s 0.00s -
Emit time 0.00s 0.00s -
Total time 6.19s 5.23s -15.51%

Comment on lines -34 to -38
? Compute<
{ [k in Exclude<keyof data, head>]: data[k] } & {
[k in head]: Update<data[k], value, tail>;
}
>
Copy link
Owner Author

Choose a reason for hiding this comment

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

Removing compute and using an homomorphic object decreases the number of instantiations by 33%.

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.

1 participant