-
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.
Optimize
TokenMap
updates and traversals for modified files only (#…
…6464) ## Description This PR introduces significant optimisations in how we handle `TokenMap` updates and file traversals, resulting in substantial performance improvements. #### Key Changes: 1. Selective TokenMap Clearing: Instead of clearing the entire `TokenMap` on each keystroke, we now only clear tokens belonging to the modified file. 2. Targeted Traversal: We've limited the traversal to only the modified file, eliminating unnecessary processing of unchanged dependencies and workspace files. #### Performance Impact: These optimisations have led to substantial improvements in traverse times, particularly for subsequent traversals: | Build Type | Before (ms) | After (ms) | Absolute Improvement (ms) | Relative Improvement (%) | |------------|-------------|------------|---------------------------|--------------------------| | Release | 16.218875 | 4.758958 | 11.459917 | 70.66% | | Debug | 30.196084 | 7.144166 | 23.051918 | 76.34% | closes #6292 related to #5445 ## 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
2b0376b
commit 93cc212
Showing
4 changed files
with
152 additions
and
39 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