TimelyDataflow / timely-dataflow

A modular implementation of timely dataflow in Rust
MIT License
3.31k stars 272 forks source link

Introduce `SmallVec` for small allocations #581

Closed frankmcsherry closed 2 months ago

frankmcsherry commented 2 months ago

This PR introduce the use of SmallVec for allocations backing ChangeBatch and Antichain. These often have at most two and one, respectively, elements in them. I made ChangeBatch itself generic, and Antichain not. Probably best to unify these.

It takes a modified event_driven.rs from

cargo run --example event_driven --release -- 1000 1000 no  5.31s user 0.59s system 96% cpu 6.124 total

to

cargo run --example event_driven --release -- 1000 1000 no  4.56s user 0.59s system 95% cpu 5.382 total

Some noise is these measurements, but the relative improvement seems consistent.