Skip to content

Commit

Permalink
Re-add Delta granularity
Browse files Browse the repository at this point in the history
  • Loading branch information
aherlihy committed Aug 13, 2023
1 parent e44911f commit 50f7077
Show file tree
Hide file tree
Showing 54 changed files with 2,492 additions and 42 deletions.
3 changes: 2 additions & 1 deletion bench/src/test/scala/datalog/benchmarks/DLBenchmark.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ abstract class DLBenchmark {
// JIT options
val jitGranularities = Seq(
Granularity.ALL,
Granularity.RULE
Granularity.RULE,
Granularity.DELTA
)

// --> uncomment for JIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,58 @@ class XXackermann_optimized() extends ExampleBenchmarkGenerator(
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// -> DELTA

// ---> blocking
// ------> quotes & splices
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_quotes_EOL_ci(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_quotes_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> bytecode gen
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> lambda
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,58 @@ class XXackermann_worst() extends ExampleBenchmarkGenerator(
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// -> DELTA

// ---> blocking
// ------> quotes & splices
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_quotes_EOL_ci(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_quotes_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> bytecode gen
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> lambda
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}
}
54 changes: 54 additions & 0 deletions bench/src/test/scala/datalog/benchmarks/examples/andersen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,58 @@ class andersen() extends ExampleBenchmarkGenerator(
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// -> DELTA

// ---> blocking
// ------> quotes & splices
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_quotes_EOL_ci(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_quotes_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> bytecode gen
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> lambda
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}
}
54 changes: 54 additions & 0 deletions bench/src/test/scala/datalog/benchmarks/examples/anonvar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,58 @@ class anonvar() extends ExampleBenchmarkGenerator(
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// -> DELTA

// ---> blocking
// ------> quotes & splices
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_quotes_EOL_ci(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_quotes_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> bytecode gen
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> lambda
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,58 @@ class XXcbaexprvalue_optimized() extends ExampleBenchmarkGenerator(
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// -> DELTA

// ---> blocking
// ------> quotes & splices
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_quotes_EOL_ci(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_quotes_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> bytecode gen
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> lambda
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,58 @@ class XXcbaexprvalue_worst() extends ExampleBenchmarkGenerator(
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// -> DELTA

// ---> blocking
// ------> quotes & splices
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_quotes_EOL_ci(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_quotes_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> bytecode gen
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_bytecode_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ------> lambda
// ---------> sorted
@Benchmark def jit_default_sel__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}

// ---------> unsorted
@Benchmark def jit_default_unordered__0_blocking_DELTA_lambda_EOL(blackhole: Blackhole): Unit = {
val p = s"${Thread.currentThread.getStackTrace()(2).getMethodName.split("_EOL").head}"
if (!programs.contains(p))
throw new Exception(f"Error: program for '$p' not found")
blackhole.consume(run(programs(p), result))
}
}
Loading

0 comments on commit 50f7077

Please sign in to comment.