Skip to main content

push_run

Function push_run 

Source
fn push_run<D: Data>(runs: &mut Vec<Chain<D>>, run: Chain<D>)
Expand description

Push run onto the stack of runs, merging it into its predecessors while it holds at least half as many updates as they do.

The stack then holds runs of geometrically decreasing size, a number logarithmic in the updates, so the final merge stays narrow. Updates that cancel do so at the first merge that brings them together rather than in the final one. A merged run is one generation deeper than its inputs, so the pool can compress the runs that wait longest for the final merge.