Skip to content

Make context expression evaluation efficient

Administrator requested to merge context-expression-perf into master

Created by: felixfbecker

Fixes #3778 Fixes #3192

Seperates the parsing from the evaluation by requiring that the expressions must be parsed before registration into Expression<T>/TemplateExpression objects. Those objects can then be directly evaluated. It uses mapped types to represent Evaluated and Raw contributions. This also makes the schema way more type safe.

In addition, I vetted all sources that cause the parsing and evaluation of expressions (context, active extensions, editors, ...) and optimized them to not emit when they didn't change:

  • change ContextService have an updateContext() method that checks first if there are any changes instead of exposing raw Subject
  • make sure editors doesn't emit if an underlying model content changed
  • add publishReplay(1) in places with multiple Subscribers and expensive comparisons.

Test Plan

Code Hosts
  • GitHub
  • GitHub Enterprise
  • Refined GitHub
  • Phabricator
  • Phabricator integration
  • Bitbucket
  • Gitlab
Browsers
  • Chrome
  • Firefox

Merge request reports

Loading