Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libflux/dispatch: add fastpath for tagged responses
When a message watcher is registered for a tagged response, use O(1) array lookup to map the tag in the response back to the message handler rather the O(N) list traversal. Start with 32 entries for single RPCs and 32 for group RPCs. Expand that as needed. Since the tagpool is LIFO, the array size is a function of the maximum number of concurrent requests in flight. This should solve #680 where a large backlog of requests, such as flush requests from content cache to backing store, can cause the dispatcher to spend a *lot* of time walking that list. This fastpath is not used in coproc mode. Coproc mode is less commonly used and it is more challenging to implement the fastpath in that context.
- Loading branch information
Showing
1 changed file
with
164 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters