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
I have confirmed that this should be classified as an enhancement rather than a bug/feature.
Summary
The current implementation of the updateSubscription method in the code has a potential issue with the time complexity of the loop. The loop iterates over the subscription table to check if a topic exists in the subscription list. This results in a time complexity of O(n) for each iteration.
Motivation
Optimize performance for a large scale of subscriptions.
Describe the Solution You'd Like
To optimize the time complexity, we can introduce an additional HashSet to store the new topics. By doing so, we can perform a constant time (O(1)) lookup instead of iterating over the subscription table in the loop. This will significantly reduce the time complexity of the loop.
Describe Alternatives You've Considered
No
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Before Creating the Enhancement Request
Summary
The current implementation of the updateSubscription method in the code has a potential issue with the time complexity of the loop. The loop iterates over the subscription table to check if a topic exists in the subscription list. This results in a time complexity of O(n) for each iteration.
Motivation
Optimize performance for a large scale of subscriptions.
Describe the Solution You'd Like
To optimize the time complexity, we can introduce an additional HashSet to store the new topics. By doing so, we can perform a constant time (O(1)) lookup instead of iterating over the subscription table in the loop. This will significantly reduce the time complexity of the loop.
Describe Alternatives You've Considered
No
Additional Context
No response
The text was updated successfully, but these errors were encountered: