Ericsson / libpaf

Pathfinder service discovery client library
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Improve performance for large number of protocol transactions #11

Open m-ronnblom opened 3 years ago

m-ronnblom commented 3 years ago

In case a single client (i.e. libpaf context) has a large number of concurrent protocol transactions toward a server, processing latency per transaction increases.

This may happen in case a client decides to publish a very large number of services at the same time, or in case it has a very large number of subscriptions. "Large" here need to be something in the thousands or tens of thousands to become noticeable.

This slow-down is primarily due to the fact that ongoing transactions are stored in a linked list, and finding a particular transaction requires O(N) time.