Skip to content

Commit

Permalink
improve crdt plan for souffle
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmcsherry committed Apr 28, 2020
1 parent 17a8b1f commit 0fca831
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ We also use the excellent [Soufflé](https://souffle-lang.github.io) as a non-dy

For each problem we record reported times for various systems in various configurations, both to perform any query-specific compilation and then execution. These measurements are meant to be representative rather than definitive. All of the systems support multiple worker threads, and could be run in a variety of configurations on a variety of hardware platforms.

Soufflé can often benefit from join planning help; without this help it can take orders of magnitude longer than it could. Such help is currently only provided for the Doop benchmark, and measurements for other queries could improve in the future (especially for those runs in which it did not finish in 1,000 seconds). The Soufflé measurements are all directly using the `query.dl` file from the decompressed `input` directory, either with the `-c` flag (for compilation) or without (for interpretation).
Soufflé can often benefit from join planning help; without this help it can take orders of magnitude longer than it could. Such help is currently provided for the CRDT and Doop benchmarks, and measurements for other queries could improve in the future (especially for those runs in which it did not finish in 1,000 seconds). The Soufflé measurements are all directly using the `query.dl` file from the decompressed `input` directory, either with the `-c` flag (for compilation) or without (for interpretation).

Unlike other measurements, the Differential Dataflow measurements are for hand-written code in a larger language, and can reflect implementation and optimizations not easily available within Datalog. Links to this code should be forthcoming (it's just in a few different places at the moment).
Unlike other measurements, the Differential Dataflow measurements are for hand-written code in a larger language, and can reflect implementation and optimizations not easily available within Datalog. The code for each problem is in the `differential/` directory.

#### The CRDT benchmark

| Engine | Compilation | Evaluation | Cores | Notes |
|----------------------:|--------------:|--------------:|------:|----------:|
| Soufflé (interpreted) | 0s | 1000s+ (DNF) | 1 | Laptop |
| Soufflé (compiled) | 10.15s | 1000s+ (DNF) | 1 | Laptop |
| Soufflé (compiled) | 10.15s | 294.73s | 1 | Laptop |
| Differential Dataflow | 166.26s | 3.44s | 1 | Laptop |
| Declarative Dataflow | 0s | | | |
| Differential Datalog | | | | |
Expand Down
9 changes: 2 additions & 7 deletions differential-dataflow/src/bin/galen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ fn main() {
let p_var = iterate::MonoidVariable::new(inner, Product::new(Default::default(), 1));
let q_var = iterate::MonoidVariable::new(inner, Product::new(Default::default(), 1));

// use differential_dataflow::operators::reduce::ReduceCore;
// use differential_dataflow::trace::implementations::ord::OrdKeySpine;
// let p_self = p_var.reduce_abelian::<_,OrdKeySpine<_,_,_>>(move |_,_,t| t.push(((), 1)));
// let q_self = q_var.reduce_abelian::<_,OrdKeySpine<_,_,_>>(move |_,_,t| t.push(((), 1)));

// accumulate
let p_new = p_var.distinct();
let q_new = q_var.distinct();
Expand Down Expand Up @@ -100,10 +95,10 @@ fn main() {
let prefix = std::env::args().nth(1).expect("must specify path prefix");

for (x,y,z) in load3(worker.index(), &prefix, "c.txt") { c.insert((x,y,z)); }
for (x,y) in load2(worker.index(), &prefix, "p.txt") { p.insert((x,y)); }
for (x,y) in load2(worker.index(), &prefix, "p.txt") { p.insert((x,y)); }
for (x,y,z) in load3(worker.index(), &prefix, "q.txt") { q.insert((x,y,z)); }
for (x,y,z) in load3(worker.index(), &prefix, "r.txt") { r.insert((x,y,z)); }
for (x,y) in load2(worker.index(), &prefix, "s.txt") { s.insert((x,y)); }
for (x,y) in load2(worker.index(), &prefix, "s.txt") { s.insert((x,y)); }
for (x,y,z) in load3(worker.index(), &prefix, "u.txt") { u.insert((x,y,z)); }

}).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion problems/crdt/query.dl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ hasValue(Elem) :- currentValue(Elem, _).

.decl skipBlank(From: id, To: id)
skipBlank(From, To) :- nextElem(From, To).
skipBlank(From, To) :- nextElem(From, Via), !hasValue(Via), skipBlank(Via, To).
skipBlank(From, To) :- skipBlank(Via, To), nextElem(From, Via), !hasValue(Via).

.decl nextVisible(Prev: id, Next: id)
nextVisible(Prev, Next) :- hasValue(Prev), skipBlank(Prev, Next), hasValue(Next).
Expand Down

0 comments on commit 0fca831

Please sign in to comment.