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

TSC Graph Context: fix performance #4095

Merged
merged 1 commit into from May 15, 2024

Conversation

olafurpg
Copy link
Member

@olafurpg olafurpg commented May 8, 2024

Fixes CODY-1434

Previously, the tsc-mixed context retriever made the UI freeze because it was doing super inefficient things with context expansion. This PR fixes the problem so that the performance is back to normal.

Test plan

Green CI.

I tested this change manually in large projects and confirmed that the latency overhead for tsc context-retriever is no longer huge. For example, it's 33ms here on line 1300 in the largest file in svelte/language-tools repo
CleanShot 2024-05-15 at 14 40 24@2x

@olafurpg
Copy link
Member Author

olafurpg commented May 9, 2024

Good news: I've maybe the biggest performance mistake (not caching script snapshots) so loading the compiler is now only slow once (not on every keystroke!).

Bad news: loading the compiler is still too slow in large codebases (6s in sg/sg) and symbol collection is still too slow (~200ms) for a small file.

@olafurpg olafurpg force-pushed the olafurpg/cody-1434-faster-performance branch 3 times, most recently from ec6e573 to 90a0cbd Compare May 15, 2024 12:02
Fixes CODY-1434

Previously, the `tsc-mixed` context retriever made  the UI freeze
because it was doing super inefficient things with context expansion.
This PR fixes the problem so that the performance is back to normal.
@olafurpg olafurpg force-pushed the olafurpg/cody-1434-faster-performance branch from 90a0cbd to 97b578a Compare May 15, 2024 12:39
@olafurpg olafurpg marked this pull request as ready for review May 15, 2024 12:39
@olafurpg olafurpg requested a review from a team May 15, 2024 12:44
@olafurpg
Copy link
Member Author

Tagged stampers for review since this is a low-risk PR to merge. The TSC context is disabled by default

@olafurpg olafurpg merged commit 26b7c9f into main May 15, 2024
37 checks passed
@olafurpg olafurpg deleted the olafurpg/cody-1434-faster-performance branch May 15, 2024 12:51
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.

None yet

2 participants