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

Conversation

Projects
None yet
1 participant
@Krzysztof-Cieslak
Copy link
Collaborator

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 Jun 6, 2019

@Krzysztof-Cieslak Krzysztof-Cieslak merged commit 7742e6b into master Jun 8, 2019

3 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@Krzysztof-Cieslak Krzysztof-Cieslak deleted the crazy branch Jun 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.