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
Cost of IContextKeyService#onDidChangeContext #71642
Comments
I have pushed and adopted I will push some more tweaks to the event itself but not do the event-pausing on lifecycle events. |
@sandy081 I leave the |
@jrieken I looked into this a bit deeply to see if I can start listening to context only when viewlet is visible. But there is a usecase in activity bar to hide viewlet icon if it has no active views. So this needs me to build the model by reading and listening to context keys. |
Since no action can be taken un-assigning myself. |
no action then |
Context keys have become popular, they drive keybindings, menus, and views. The latter two depend on events because they are stateful and need to update when context keys change. Simple instrumentation shows that during startup the event fires ~233 times and costs around 90ms (on my early 2015 MBP). Observations
ViewDescriptorCollection
(explorer, search, scm, etc. etc) listens to the event no matter if it's visible or not cc @sandy081myKey.set(value)
. For instance,EditorModeContext#_update
might trigger 19 events, instead of oneStarting
andReady
, so often before the UI shows much. Should the service buffer events tillRestored
?The text was updated successfully, but these errors were encountered: