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

Implement Background Service #396

Merged
merged 10 commits into from
Jun 8, 2019
Merged

Implement Background Service #396

merged 10 commits into from
Jun 8, 2019

Conversation

Krzysztof-Cieslak
Copy link
Member

@Krzysztof-Cieslak Krzysztof-Cieslak commented Jun 6, 2019

Ok, this is huge. It's evolution of current SymbolCache and implements some of the ideas I've described in Krzysztof-Cieslak/notes#1

  1. SymbolCache project is removed, and we have new project called BackgroundService.
  2. BackgroundService communicates with the FSAC using JSON-RPC (implementation from our LSP implementation)
  3. With BackgroundService enabled (hopefully turned on by default in Ionide), FSAC doesn't perform almost any background processing - it's focused only on responding to the requests that happened and typechecking current file. It means that there is much smaller pressure on reactor queue and FSAC is much more responsive. (IT'S FAST)
  4. With BackogrundService enabled, FSharpChecker used by FSAC doesn't need to cache background resolutions which decrease memory usage (just in FSAC process)
  5. With BackgroundService enabled, FSharpChecker used by FSAC doesn't implicitly start background processing
  6. File state is synchronized between FSAC and BackgroundService.
  7. BackgroudnService is responsible for typechecking files from current project, getting errors and pushing them to FSAC (that pushed it forward to client)
  8. BackgroundService is responsible for finding all symbols and usaged in typechecked file and puts that into SQLite DB
  9. Symbols are not longer kept in memory - it turns out SQLite is fast, and we may just query local DB directly from FSAC when needed
  10. Background service has also functionality for typechecking whole projects (on file save) but it's disabled due to the CPU and memory usage this creates.
  11. As described in the document linked above - it probably increases total memory and CPU usage [EDIT: probably not so much - there is visble decrease in FSAC CPU and memory usage due to not keeping background resolutions, lack of background typechecking and lack of symbol calculations] ... but in a way that's not visible to the user - FSAC is always responsive.

@Krzysztof-Cieslak Krzysztof-Cieslak force-pushed the crazy branch 2 times, most recently from a634e0c to 25e4950 Compare June 6, 2019 22:02
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.

1 participant