-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0faa165
commit 6af29df
Showing
18 changed files
with
196 additions
and
199 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
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
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
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,7 +1,12 @@ | ||
// SPDX-FileCopyrightText: Copyright © 2023 {name}. All rights reserved. | ||
// SPDX-License-Identifier: {license} | ||
|
||
fn main() { | ||
// println!("cargo:rerun-if-changed=src/lib.rs"); | ||
// println!("cargo:rerun-if-changed=build.rs"); | ||
} | ||
// Copyright notice and licensing information. | ||
// These lines indicate the copyright of the software and its licensing terms. | ||
// Copyright © 2024 {name}. All rights reserved. | ||
// SPDX-License-Identifier: {license} | ||
|
||
//! This is the main function for the build script. | ||
//! | ||
//! Currently, it only instructs Cargo to re-run this build script if `build.rs` is changed. | ||
fn main() { | ||
// println!("cargo:rerun-if-changed=src/lib.rs"); | ||
// println!("cargo:rerun-if-changed=build.rs"); | ||
} |
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,50 +1,52 @@ | ||
// SPDX-FileCopyrightText: Copyright © 2023 {name}. All rights reserved. | ||
// SPDX-License-Identifier: {license} | ||
|
||
extern crate criterion; | ||
|
||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use {name}::{run, {name}_vec, {name}_map, {name}_join}; | ||
|
||
fn {name}_vec_benchmark(c: &mut Criterion) { | ||
c.bench_function("{name}_vec_macro", |b| { | ||
b.iter(|| { | ||
{name}_vec![1, 2, 3, 4, 5] | ||
}) | ||
}); | ||
} | ||
|
||
fn {name}_map_benchmark(c: &mut Criterion) { | ||
c.bench_function("{name}_map_macro", |b| { | ||
b.iter(|| { | ||
{name}_map!["a" => 1, "b" => 2, "c" => 3, "d" => 4, "e" => 5] | ||
}) | ||
}); | ||
} | ||
|
||
fn {name}_join_benchmark(c: &mut Criterion) { | ||
c.bench_function("{name}_join_macro", |b| { | ||
b.iter(|| { | ||
{name}_join!["a", "b", "c", "d", "e"] | ||
}) | ||
}); | ||
} | ||
|
||
fn {name}_benchmark(c: &mut Criterion) { | ||
c.bench_function("{name}", |b| { | ||
b.iter(|| { | ||
for _ in 0..1000 { | ||
run().unwrap(); | ||
} | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!( | ||
{name}_macros_benchmark, | ||
{name}_vec_benchmark, | ||
{name}_map_benchmark, | ||
{name}_join_benchmark, | ||
{name}_benchmark | ||
); | ||
criterion_main!({name}_macros_benchmark); | ||
// Copyright notice and licensing information. | ||
// These lines indicate the copyright of the software and its licensing terms. | ||
// Copyright © 2024 {name}. All rights reserved. | ||
// SPDX-License-Identifier: {license} | ||
|
||
extern crate criterion; | ||
|
||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use {name}::{run, {name}_vec, {name}_map, {name}_join}; | ||
|
||
fn {name}_vec_benchmark(c: &mut Criterion) { | ||
c.bench_function("{name}_vec_macro", |b| { | ||
b.iter(|| { | ||
{name}_vec![1, 2, 3, 4, 5] | ||
}) | ||
}); | ||
} | ||
|
||
fn {name}_map_benchmark(c: &mut Criterion) { | ||
c.bench_function("{name}_map_macro", |b| { | ||
b.iter(|| { | ||
{name}_map!["a" => 1, "b" => 2, "c" => 3, "d" => 4, "e" => 5] | ||
}) | ||
}); | ||
} | ||
|
||
fn {name}_join_benchmark(c: &mut Criterion) { | ||
c.bench_function("{name}_join_macro", |b| { | ||
b.iter(|| { | ||
{name}_join!["a", "b", "c", "d", "e"] | ||
}) | ||
}); | ||
} | ||
|
||
fn {name}_benchmark(c: &mut Criterion) { | ||
c.bench_function("{name}", |b| { | ||
b.iter(|| { | ||
for _ in 0..1000 { | ||
run().unwrap(); | ||
} | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!( | ||
{name}_macros_benchmark, | ||
{name}_vec_benchmark, | ||
{name}_map_benchmark, | ||
{name}_join_benchmark, | ||
{name}_benchmark | ||
); | ||
criterion_main!({name}_macros_benchmark); |
Oops, something went wrong.