luri ron wrote:p.s., I have not yet seen a pratical use case for this class.
luri ron wrote:the idea of duplicating the data structure anytime a new member is added is quite expensive.
luri ron wrote:hm.. why use lock? use ConcurrentSkipListSet for your listeners. no need to lock to iterate through the listeners, and there is no concurrentmodificationexception.
luri ron wrote:how many listeners you have in the structure for your performance test?
the search time a list is O(n) compared with skiplist is O(log(n)) which is faster for removal and search.
in term of duplicate, it is probably better not to have duplicated listener?
send notification in order is an advantage for the list, but in a distributed environment. this has a lot to do with the network rather than what order the listeners are stored in.