You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a workspace level TokenMap and Engines (#7139)
## Description
This PR moves `TokenMap` and `Engines` out of the `Session` type up to
`ServerState` so a single instance of each can be shared across all
workspace members.
Up until now, each workspace member used a unique `Engines`. This meant
the standard library and any other dependancies were unable to utilise
the `QueryEngine` cache, leading to lots of duplicate entries. This was
leading to inflated initialization times when opening a new workspace
member and significantly increasing the RAM footprint of the language
server.
For example, opening each workspace member in the FUSD projects
workspace would see RAM usage exceeding ~30.0 gig. Now we no longer
exceed 2.0 gig of RAM.
Future PR's will move the `BuildPlanCache` up to the `ServerState` level
as well.
part of #7111 & #6226closes#5645closes#5856
## Checklist
- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] 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.
---------
Co-authored-by: kaya <kaya.gokalp@fuel.sh>
0 commit comments