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

Optimized language server build #719

Merged
merged 5 commits into from
Jan 19, 2024
Merged

Conversation

SimonCockx
Copy link
Contributor

@SimonCockx SimonCockx commented Jan 18, 2024

Notes based on opening a DRR workspace.

  • A lot of time seems to be spent on injection.
    • Specifically, about 54% of "code generation" is spent on injecting Xsemantics generated classes RosettaTyping and RosettaTypingAuxiliary.
    • ! Making these singleton classes brings this down to 1.5%. That results in -23% overal time.
  • A lot of time seems to be spent on code generation.
    • Could partially be due to preprocessing step for identifiers? Needs more investigation.
  • Building seems to be triggered twice!
    • This is only the case for the visual code plugin; not for the Rosetta IDE, since the BSP "fixes" this.
    • ! Disabling the initial build further results in -35% time.
    • Update: this was a red herring. The build did not get triggered twice by an actual language client such as VS Code or the Rosetta IDE. I rather adjusted the test.
  • Resolving cross references takes about 1.3 times more time than validation.
    • Some time spent on filtering scopes.
    • ! Refactoring reverse shadowing of features of the implicit variable further results in -13%.
    • 26% spent on getRType. => mostly because references aren't resolved yet. Probably a red herring.
  • Validation seems to be triggered twice!
    • One extra trigger during the shouldGenerate check.
    • ! Caching validation results further results in -28%.
  • Validation does not take that much time.
    • In order: (total 2834ms)
      • (700ms) RosettaSimpleValidator::checkReportType ! Old blueprint leftover! Removed it.
      • (266ms) RosettaSimpleValidator::checkTypeExpectation
      • (250ms) RosettaSimpleValidator::checkClosureParameterNamesAreUnique
      • (238ms) StandaloneRosettaTypingValidator::checkReportType
    • ! Caching type inference further results in -16%.
    • ! Caching report input type inference halves the time spent on checkReportType.
  • Micro-optimizations:
    • DottedPath.split -> !removed usage of regexes: -3.4%.

@SimonCockx SimonCockx closed this Jan 18, 2024
@SimonCockx SimonCockx reopened this Jan 18, 2024
@SimonCockx SimonCockx merged commit d8047a6 into master Jan 19, 2024
14 of 22 checks passed
@SimonCockx SimonCockx deleted the optimize-language-server branch January 19, 2024 10:12
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.

2 participants