Summary: This will be needed by logging components - eg QLog
Reviewed By: hanidamlaj
Differential Revision: D72476485
fbshipit-source-id: 3b7f3e81e87fc6cc2a252293208863d33bd5df50
Summary:
This is a reimplementation of the HTTP priority queue with the new API. The new design is:
A single vector-based heap for sequential streams across all levels and an array of 8 RoundRobin's that hold incremental streams.
Getting the highest priority element doesn't require iterating through empty levels - it's right at the front of `heap_` or `roundRobins_[lowestRoundRobin_]`.
There's an index map which incremental streams always use, the value is an index into roundRobins_. When there are a large number of sequential streams in the heap_, we also index those (with their array index).
The benchmarks (next diff) show that this is 2x faster for 8 streams and 20% slower for large numbers of sequential streams (96). The break-even point is 40 streams.
Reviewed By: mjoras
Differential Revision: D68641759
fbshipit-source-id: 30ea5c719e998ead20d8762ee5ddad10111ea7e5