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.