This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganise benchmarks and add noop-planning (#26)
Change-Id: I61ff1d8ddcae2c99f74ef2ee2ba6b5da7d30c794
- Loading branch information
Showing
5 changed files
with
103 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2022 Google LLC | ||
// | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file or at | ||
// https://developers.google.com/open-source/licenses/bsd | ||
|
||
use criterion::{criterion_group, criterion_main}; | ||
|
||
mod checking_and_planning; | ||
mod checking_only; | ||
mod demo; | ||
|
||
use checking_and_planning::*; | ||
use checking_only::*; | ||
use demo::*; | ||
|
||
criterion_group!( | ||
benches, | ||
criterion_benchmark_checking_only, | ||
criterion_benchmark_noop_planning, | ||
criterion_benchmark_solve_demo | ||
); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright 2022 Google LLC | ||
// | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file or at | ||
// https://developers.google.com/open-source/licenses/bsd | ||
|
||
use criterion::{black_box, Criterion}; | ||
use ibis::best_solutions_to_json; | ||
|
||
fn solve_demo(data: &str) { | ||
let _result = best_solutions_to_json(&data); | ||
// TODO: use the result to ensure it is correct | ||
} | ||
|
||
pub fn criterion_benchmark_noop_planning(c: &mut Criterion) { | ||
let data = r#" | ||
{ | ||
"flags": { | ||
"planning": true | ||
}, | ||
"capabilities": [ | ||
["write", "read"], | ||
["any", "read"], | ||
["write", "any"] | ||
], | ||
"subtypes": [ | ||
["Int", "Number"], | ||
["Int", "Serializable"], | ||
["String", "Serializable"] | ||
], | ||
"less_private_than": [ | ||
["public", "private"] | ||
], | ||
"recipes": [ | ||
{ | ||
"nodes": [ | ||
["p_a", "a", "write", "Int"], | ||
["p_b", "b", "any", "Number"], | ||
["p_c", "c", "write", "String"], | ||
["p_de", "d", "read", "Serializable"], | ||
["p_de", "e", "read", "ibis.UnionType(Number, String)"], | ||
["p_f", "f", "write", "ibis.ProductType(name: String, age: Int)"], | ||
["p_g", "g", "read", "name: *"], | ||
["p_h", "h", "read", "ibis.ProductType(name: String, age: Int)"], | ||
["p_i", "i", "read", "name: String"], | ||
["p_j", "j", "read", "age: Int"] | ||
], | ||
"claims": [ | ||
["a", "private"] | ||
], | ||
"checks": [ | ||
["e", "public"] | ||
], | ||
"trusted_to_remove_tag": [ | ||
["b", "private"] | ||
], | ||
"edges": [ | ||
["a", "b"], | ||
["b", "e"], | ||
["c", "d"], | ||
["c", "e"], | ||
["f", "b"], | ||
["f", "d"], | ||
["f", "e"], | ||
["f", "g"], | ||
["f", "h"], | ||
["f", "i"], | ||
["f", "j"] | ||
] | ||
} | ||
] | ||
} | ||
"#; | ||
c.bench_function("noop_planning", |b| b.iter(|| solve_demo(black_box(data)))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters