remove nightly features
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
#![feature(custom_test_frameworks)]
|
||||
#![test_runner(criterion::runner)]
|
||||
use parsing::{split_function_chars, SplitType};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use parsing::split_function_chars;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use std::time::Duration;
|
||||
use std::{fs::File, os::raw::c_int, path::Path};
|
||||
|
||||
use criterion::profiler::Profiler;
|
||||
#[allow(unused_imports)]
|
||||
use criterion::{BenchmarkId, Criterion};
|
||||
use criterion_macro::criterion;
|
||||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
use pprof::ProfilerGuard;
|
||||
|
||||
pub struct FlamegraphProfiler<'a> {
|
||||
@@ -62,7 +55,6 @@ fn custom_criterion_flamegraph() -> Criterion {
|
||||
custom_criterion().with_profiler(FlamegraphProfiler::new(100))
|
||||
}
|
||||
|
||||
#[criterion(custom_criterion())]
|
||||
fn mutli_split_function(c: &mut Criterion) {
|
||||
let data_chars = vec![
|
||||
"sin(x)cos(x)",
|
||||
@@ -86,20 +78,23 @@ fn mutli_split_function(c: &mut Criterion) {
|
||||
for entry in data_chars {
|
||||
group.bench_function(entry.iter().collect::<String>(), |b| {
|
||||
b.iter(|| {
|
||||
split_function_chars(&entry, parsing::suggestions::SplitType::Multiplication);
|
||||
split_function_chars(&entry, SplitType::Multiplication);
|
||||
})
|
||||
});
|
||||
}
|
||||
group.finish();
|
||||
}
|
||||
|
||||
// #[criterion(custom_criterion_flamegraph())]
|
||||
// Uncomment to enable flamegraph profiling
|
||||
// fn single_split_function(c: &mut Criterion) {
|
||||
// let data_chars = "(2x+1)(3x+1)".chars().collect::<Vec<char>>();
|
||||
|
||||
//
|
||||
// c.bench_function("split_function", |b| {
|
||||
// b.iter(|| {
|
||||
// split_function_chars(&data_chars);
|
||||
// split_function_chars(&data_chars, SplitType::Multiplication);
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
criterion_group!(benches, mutli_split_function);
|
||||
criterion_main!(benches);
|
||||
|
||||
Reference in New Issue
Block a user