You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make eager service registration explicit and revisit existing one #159178
The registerSingleton-function supports a supportsDelayedInstantiation-argument.
With InstantiationType.Delayed only proxies of services are injected and the actual instantiation happens in "slack/idle" time or at time of first actual use (whatever comes first). This is often overlooked and the default (false, eager) is used. This issue is about:
revisit existing eager usages and check if they can support delayed instantiation. This is the preferred way, helps startup performance 🐎 , and is usually possible
make the eager variant explicit, use InstantiationType.Eager, and feel a little bad about it 😳
Note that Eager should only be needed if your service is doing something "by its own", like reading files or so, which is vital to other parts of the system. This should be the exception because most services offer something (a service) to others which means can be delayed until needed
Went over the ones I consider owning and found some that can be lazy: #159899
Some observations:
would be nice to somehow signal back that service cannot be lazy so that we know which ones are not acknowledged (I guess that is the purpose of this issue but might be nicer to validate in code)
services that are implemented from a workbench part are instantiated on startup anyway because workbench parts are never lazy (even when hidden)
I was not so sure for the ext-host services, they seem to require the main side proxy in their constructor so I left them, maybe we do a pass at once in those
Activity
jrieken commentedon Aug 29, 2022
Sandeep Somavarapu (@sandy081) starting with you because many of your services show as eager
code lens cache can be created delayed
code lens cache can be created delayed (#159531)
#159178 make service instantiation lazy
make service instantiation lazy (#159680)
sandy081 commentedon Sep 1, 2022
Johannes Rieken (@jrieken) adopted those service I own
jrieken commentedon Sep 2, 2022
Benjamin Pasero (@bpasero) you are next :-)
perf - more lazy services (#159178)
bpasero commentedon Sep 2, 2022
Went over the ones I consider owning and found some that can be lazy: #159899
Some observations:
76 remaining items
make eager service registration explicit
make eager service registration explicit (#163558)
Delay external uri opener
Delay external uri opener (#164190)
jrieken commentedon Oct 25, 2022
Thanks everyone!