KthWake

Run 4,096 rolling thresholds on one timer.

Give KthWake a timestamp and an arrival count. It tells your scheduler which rules changed and when to wake if traffic stops. Replay a single rule below, or download the header and benchmark all 4,096 on recorded traffic.

Window explorer

guard = 0
Arrivals and callback state over time
ArrivalThreshold metClock
Window count
Threshold met
Idle expiry

Workload

Use comma-separated ticks. Repeated ticks add multiple arrivals in one step.

Callback log

TickStateTrigger
Drive the C++ index

Pass each timestamp’s arrivals together. Use the next expiry to drive the clock during idle periods. At a shared timestamp, a single step applies expirations and arrivals before reporting changes.

index.step(t, arrivals, callback);
auto deadline = index.next_expiry();

Run the native index

Include the single header in a C++17 service, or build the command-line replay tool from the complete source release.

37.1 ms for 330,890 transitions

On a held-out Azure trace with 4,096 modeled individual-rate policies, the fastest tested alternative took 75.0 ms. A dedicated heap won the other two Azure timer workloads. Inspect all results.

Run the example

In the extracted source directory, run the bundled trace through the native CLI.

make example