Yeah, another data structure could be added - could be a hash table for that matter, but I think the array needs to stay because the native code is using it. Well, I am treating the native implementation as a black box.
On Feb 25, 2011, at 12:54 PM, Chuck Remes wrote: > > On Feb 25, 2011, at 2:50 PM, Michael Kogan wrote: > >> Would it be a good idea for the Socket.unregister method to take an index as >> well a a socket? Seems like we are wasting time running through an array? >> > > I suggest keeping the API as simple as possible. If you need a faster search, > hide those implementation details behind the API instead of exposing them to > the user. For example, use a binary tree to store the sockets so you can have > O(nlgn) access & modification times. > > It's highly unlikely that a performance bottleneck in your application will > come about due to the time it takes to find the socket you are deregistering. > :) > > cr > > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
