TimelyDataflow / differential-dataflow

An implementation of differential dataflow using timely dataflow on Rust.
MIT License
2.53k stars 182 forks source link

Avoid reallocations in first `keep`, bound stash size #430

Closed antiguru closed 9 months ago

antiguru commented 9 months ago

A follow-up to #425. Retain two elements instead of three in the stash. Avoid doubling reallocations in the first keep object.

The second change is up for discussion: If we expect few (more than zero) elements to be kept, it's worse to use a complete buffer, but the cost to reallocate should quickly outweigh the const of allocating a large buffer (or, reusing one for that matter.) This also changes if we already have a buffer in the stash, where it would be clearly beneficial to use that allocation instead of getting a new one.

frankmcsherry commented 9 months ago

These changes seem good to me. Not sure what is up with the error, but modulo that looks good to me.

antiguru commented 9 months ago

I should have cargo checked before pushing :) Fixed!