Skip to content

Conversation

@jrieken
Copy link
Member

@jrieken jrieken commented Dec 21, 2022

This PR is meant to help with #168639. I saw a slight uptick for the time it takes to handle the configuration defaults contribution point. Therefore I profiled this a bit and created this PR. It's collection of tiny improvements in the hunt of a millisecond here and there. The biggest changes are around the configuration change event - on my machine its faster by around 1 to 2ms (which is 10x on the perf bot) but getting confidence in the measurements are hard and maybe flukes.

  • only send 1 onDidSchemaChange event per registerDefaultConfiguration-call
  • debounce registerConfigurationSchemas listening, before this was invoked 4 times - twice per defaultConfigurations and configuration contribution
  • use ternary search tree for ConfigurationChangeEvent This is slightly faster than the value-tree but more importantly will reduce GC pressure because the TST does lookups without allocating
  • changes IConfigurationChangeEvent#affectedKeys so that folks stop doing indexOf. Also migrated most user to the affectsConfiguration function

…voked 4 times - twice per `defaultConfigurations` and `configuration` contribution
…ly faster than the value but more importantly will reduce GC pressure because the TST does look ups without allocating

make `affectedKeys` a `ReadonlySet` (which is faster than using array.indexOf) but also migrate most listeners onto `affectsConfiguration` which is even faster

add `hasElementOrSubtree` to TST
@jrieken jrieken self-assigned this Dec 21, 2022
@jrieken jrieken enabled auto-merge December 21, 2022 15:12
@jrieken jrieken requested a review from sandy081 December 21, 2022 15:12
@vscodenpa vscodenpa added this to the January 2023 milestone Dec 21, 2022
Copy link
Member

@sandy081 sandy081 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jrieken jrieken merged commit a1be842 into main Dec 22, 2022
@jrieken jrieken deleted the joh/startupPerf branch December 22, 2022 10:16
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants