mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-15 01:39:25 +00:00
9df075b63c
Accumulators don't currently work across revisions due to a few bugs. This commit adds 2 tests to show the problems and reworks the implementation strategy. We keep track of when the values in an accumulator were pushed and reset the vector to empty when the push occurs in a new revision. We also ignore stale values from old revisions (but update the revision when it is marked as validated). Finally, we treat an accumulator as an untracked read, which is quite conservative but correct. To get better reuse, we would need to (a) somehow determine when different values were pushed, e.g. by hashing or tracked the old values; and (b) have some `DatabaseKeyIndex` we can use to identify "the values pushed by this query". Both of these would add overhead to accumulators and I didn'τ feel like doing it, particularly since the main use case for them is communicating errors and things which are not typically used from within queries. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |