-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Typed Module Caching (#6280)
## Description This PR implements a typed module caching system for the compiler when interacted with from the language server. The main goal is to improve performance by caching typed modules and reusing them when possible, reducing unnecessary recompilation. ## Key Changes - Introduced `CowCache` for efficient, thread-safe caching with copy-on-write semantics - Implemented typed module caching in the `QueryEngine` - Updated `ServerState` and `Session` to utilize the new caching system ## Performance Improvements These changes show promising performance improvements in processing didChange events, particularly for larger projects. Here are some benchmarks using the FUSD libraries Sway project (19 Sway files): | Build | Before | After | Improvement | |-------|--------|-------|-------------| | Debug | 448.25ms | 123.73ms | 72.4% faster | | Release | 103.83ms | 53.59ms | 48.4% faster | These improvements should lead to a more responsive development experience, especially when making frequent small changes. closes #6228 improves: FuelLabs/sway-vscode-plugin#172 ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [x] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
- Loading branch information
1 parent
25060f4
commit 886c0b8
Showing
17 changed files
with
752 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.