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 TypeScript LSP Perf in Expression hot path #828

Closed
wants to merge 7 commits into from

Conversation

tbezman
Copy link

@tbezman tbezman commented Jan 5, 2024

Instantiations of typeof e.User went from 2128 => 446, a speedup of 4.77x

@edgedb-cla
Copy link

edgedb-cla bot commented Jan 5, 2024

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@tbezman tbezman changed the title Typescript perf Improve TypeScript LSP Perf in Expression hot path Jan 5, 2024
@scotttrinh
Copy link
Collaborator

scotttrinh commented Jan 5, 2024

Thanks @tbezman ! This has been on my shortlist for a while (and select). I'll profile the changes to select here as well and post my findings.

Findings:

This branch
Files:                         318
Lines of Library:            28925
Lines of Definitions:        86773
Lines of TypeScript:         30274
Lines of JavaScript:             0
Lines of JSON:                   0
Lines of Other:                  0
Identifiers:                202312
Symbols:                    319771
Types:                      219055
Instantiations:            1996052
Memory used:               462790K
Assignability cache size:   146618
Identity cache size:           805
Subtype cache size:           3242
Strict subtype cache size:    2839
I/O Read time:               0.02s
Parse time:                  0.40s
ResolveModule time:          0.03s
ResolveTypeReference time:   0.01s
Program time:                0.49s
Bind time:                   0.20s
Check time:                  3.18s
printTime time:              0.00s
Emit time:                   0.00s
Total time:                  3.86s
master
Files:                         318
Lines of Library:            28925
Lines of Definitions:        86773
Lines of TypeScript:         30234
Lines of JavaScript:             0
Lines of JSON:                   0
Lines of Other:                  0
Identifiers:                202285
Symbols:                    319744
Types:                      219226
Instantiations:            1995079
Memory used:               429668K
Assignability cache size:   146621
Identity cache size:           805
Subtype cache size:           3242
Strict subtype cache size:    2841
I/O Read time:               0.02s
Parse time:                  0.39s
ResolveModule time:          0.03s
ResolveTypeReference time:   0.01s
Program time:                0.49s
Bind time:                   0.22s
Check time:                  3.19s
printTime time:              0.00s
Emit time:                   0.00s
Total time:                  3.90s

Doesn't seem to impact e.select's type-checking time. This is still a general improvement, so thanks for that! I'll help land this and get the infrastructure set up for benchmarking.

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