-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2309 from coasys/library-use-case
Iron-out edge cases for library use-case, adding extensive real-world test assertions
- Loading branch information
Showing
16 changed files
with
12,550 additions
and
276 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,18 +1,38 @@ | ||
use iai_callgrind::{library_benchmark, library_benchmark_group, main}; | ||
use scryer_prolog::machine::parsed_results::QueryResolution; | ||
|
||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] | ||
mod setup; | ||
|
||
#[library_benchmark] | ||
#[bench::count_edges(setup::prolog_benches()["count_edges"].setup())] | ||
#[bench::numlist(setup::prolog_benches()["numlist"].setup())] | ||
#[bench::csv_codename(setup::prolog_benches()["csv_codename"].setup())] | ||
fn bench(mut run: impl FnMut() -> QueryResolution) -> QueryResolution { | ||
run() | ||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] | ||
mod iai { | ||
use iai_callgrind::{library_benchmark, library_benchmark_group, main}; | ||
|
||
use scryer_prolog::machine::parsed_results::QueryResolution; | ||
|
||
use super::setup; | ||
|
||
#[library_benchmark] | ||
#[bench::count_edges(setup::prolog_benches()["count_edges"].setup())] | ||
#[bench::numlist(setup::prolog_benches()["numlist"].setup())] | ||
#[bench::csv_codename(setup::prolog_benches()["csv_codename"].setup())] | ||
fn bench(mut run: impl FnMut() -> QueryResolution) -> QueryResolution { | ||
run() | ||
} | ||
|
||
library_benchmark_group!( | ||
name = benches; | ||
benchmarks = bench | ||
); | ||
|
||
main!(library_benchmark_groups = benches); | ||
|
||
pub fn call_main() { | ||
main() | ||
} | ||
} | ||
|
||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] | ||
fn main() { | ||
iai::call_main(); | ||
} | ||
|
||
library_benchmark_group!( | ||
name = benches; | ||
benchmarks = bench | ||
); | ||
main!(library_benchmark_groups = benches); | ||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))] | ||
fn main() {} |
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
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
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
Oops, something went wrong.