(c: &mut Criterion)
| 62 | } |
| 63 | |
| 64 | fn criterion_benchmark(c: &mut Criterion) { |
| 65 | let ctx = create_context().unwrap(); |
| 66 | let rt = Runtime::new().unwrap(); |
| 67 | let test_file = generate_test_file(); |
| 68 | |
| 69 | let mut group = c.benchmark_group("load csv testing"); |
| 70 | group.measurement_time(Duration::from_secs(20)); |
| 71 | |
| 72 | group.bench_function("default csv read options", |b| { |
| 73 | b.iter(|| { |
| 74 | load_csv( |
| 75 | ctx.clone(), |
| 76 | &rt, |
| 77 | test_file.path().to_str().unwrap(), |
| 78 | CsvReadOptions::default(), |
| 79 | ) |
| 80 | }) |
| 81 | }); |
| 82 | |
| 83 | group.bench_function("null regex override", |b| { |
| 84 | b.iter(|| { |
| 85 | load_csv( |
| 86 | ctx.clone(), |
| 87 | &rt, |
| 88 | test_file.path().to_str().unwrap(), |
| 89 | CsvReadOptions::default().null_regex(Some("^NULL$|^$".to_string())), |
| 90 | ) |
| 91 | }) |
| 92 | }); |
| 93 | } |
| 94 | |
| 95 | criterion_group!(benches, criterion_benchmark); |
| 96 | criterion_main!(benches); |
nothing calls this directly
no test coverage detected
searching dependent graphs…