Skip to content

perf: Cache AST so we only re-parse files which have changed#2174

Draft
jbencin-stacks wants to merge 1 commit intostx-labs:mainfrom
jbencin-stacks:perf/ast-caching
Draft

perf: Cache AST so we only re-parse files which have changed#2174
jbencin-stacks wants to merge 1 commit intostx-labs:mainfrom
jbencin-stacks:perf/ast-caching

Conversation

@jbencin-stacks
Copy link
Copy Markdown
Contributor

@jbencin-stacks jbencin-stacks commented Feb 6, 2026

Description

Cache AST by file content hash so that we don't

This will make VSCode extension more responsive as it won't re-parse the entire project on each save. It won't help clarinet check CLI command though

Fixes: #604

Breaking change?

No

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 48.97959% with 75 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
components/clarity-lsp/src/common/state.rs 25.80% 46 Missing ⚠️
components/clarity-lsp/src/common/backend.rs 33.33% 24 Missing ⚠️
components/clarinet-deployments/src/lib.rs 89.79% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hugo-stacks
Copy link
Copy Markdown
Collaborator

Hey @jbencin-stacks
Looks like it could help.
I see it's still in draft, while you're working on it, it would be nice to be able to bench the performance gains.

Additionally, I think it might be a similar concept as the existing pub active_contracts: HashMap<FileLocation, ActiveContractData>, that has no hash but maybe should have one.

If we would benefit from iterating on this existing data instead of adding a new cache.

I haven't look at these code path in a while, so that's just some thought that I have after a quick review

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.

LSP: Introduce partial analysis

2 participants