TimelyDataflow / TimelyDataflow/differential-dataflow
Possible minor perf bug in `work`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3k
- Forks
- 211
- Avg merge
- 10h 42m
- Merged PRs (30d)
- 34
Description
It looks like work can consume exactly all of the fuel and still complete the merge:
if effort >= *fuel { *fuel = 0; }
else { *fuel -= effort; }
However, in the doc for Merger,
/// If `fuel` is non-zero after the call, the merging is complete and
/// one should call `done` to extract the merged results.
fn work(&mut self, source1: &Output::Base, source2: &Output::Base, frontier: &Option<Vec<T>>, fuel: &mut usize);
Unless I'm overlooking something, this means we may notice that the merge is in fact complete only on the next invocation of work. If work finishes with exactly zero fuel, we should be able to call done right away.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/trace/implementations/vec.rs around line 126 and compare the fuel handling with the Merger::work documentation quoted in the issue. Trace when a merge is considered complete and when done may be called; done means the exact-fuel case follows the documented completion contract without requiring another work invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100