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
When indexing any module, there is a number of concurrent operations which can index various details about a module. This means that in practice we may end up firing any of these hooks many times repeatedly in a short time period. This affects our performance at scale - e.g. if we fire 9 RPC events for each hook, that's 6*9 = 54 events for just a single module.
Clients may deduplicate some of these requests (esp. semantic token refresh) but it represents some wasted CPU to send these requests in the first place. This may negatively impact performance especially when there's many modules being indexed.
Performance will be especially important in the context of #724
Proposal
TODO
queue up change events in a separate memdb table - e.g. module_events; treat module ID as unique key to deduplicate events
set a reasonable delay per subscriber? e.g. telemetry can be <5secs whereas UI-affecting subscribers may need <1sec
maintain number of subscribers VS number of notified subscribers in memdb to ensure everyone receives the update
leverage memdb watchers on the module_events table to subscribers having to poll
The text was updated successfully, but these errors were encountered:
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Background
We use memdb hooks for a few use cases:
module.calls
ormodule.providers
dataterraform-ls/internal/langserver/handlers/service.go
Lines 423 to 459 in e612555
When indexing any module, there is a number of concurrent operations which can index various details about a module. This means that in practice we may end up firing any of these hooks many times repeatedly in a short time period. This affects our performance at scale - e.g. if we fire 9 RPC events for each hook, that's
6*9 = 54
events for just a single module.Clients may deduplicate some of these requests (esp. semantic token refresh) but it represents some wasted CPU to send these requests in the first place. This may negatively impact performance especially when there's many modules being indexed.
Performance will be especially important in the context of #724
Proposal
TODO
module_events
; treat module ID as unique key to deduplicate eventsmodule_events
table to subscribers having to pollThe text was updated successfully, but these errors were encountered: