-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Issues #2091 Improve the performance of RetainedMessages without subs… #2093
base: master
Are you sure you want to change the base?
Issues #2091 Improve the performance of RetainedMessages without subs… #2093
Conversation
…t subscribing to RetainedMessageChangedEvent.
Could you please add a Unit Tests which covers your situation? I am curious if we can make it fast even with an attached event handler (which is often the case) by converting the List to a ReadOnlyCollection etc. I am also wondering if the copy of the items to the list causes the issue or the fact that the async lock is acquired before (trying) to invoke the event. |
The output before this commit. Count:0 Retain: False, Subscribe:True, Amount: 100000, Time: 36 ms Count:0 Retain: True, Subscribe:False, Amount: 100000, Time: 41163 ms Count:0 Retain: False, Subscribe:False, Amount: 100000, Time: 49 ms The output after this commit. Count:0 Retain: False, Subscribe:True, Amount: 100000, Time: 45 ms Count:0 Retain: True, Subscribe:False, Amount: 100000, Time: 122 ms Count:0 Retain: False, Subscribe:False, Amount: 100000, Time: 49 ms ValueCollection is not IList, cannot use the constructor of ReadOnlyCollection. |
Issues #2091 Improve the performance of RetainedMessages without subscribing to RetainedMessageChangedEvent.