Some cleanup
This commit is contained in:
		| @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; | ||||
| use onebrc::implementations::flare_flo::run; | ||||
|  | ||||
| pub fn criterion_benchmark(c: &mut Criterion) { | ||||
|     c.bench_function("flareflo", |b| b.iter(|| run())); | ||||
|     c.bench_function("flareflo", |b| b.iter(run)); | ||||
| } | ||||
|  | ||||
| criterion_group!(benches, criterion_benchmark); | ||||
|   | ||||
| @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; | ||||
| use onebrc::implementations::libraries::run; | ||||
|  | ||||
| pub fn criterion_benchmark(c: &mut Criterion) { | ||||
|     c.bench_function("libraries", |b| b.iter(|| run())); | ||||
|     c.bench_function("libraries", |b| b.iter(run)); | ||||
| } | ||||
|  | ||||
| criterion_group!(benches, criterion_benchmark); | ||||
|   | ||||
| @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; | ||||
| use onebrc::implementations::multi_threaded::run; | ||||
|  | ||||
| pub fn criterion_benchmark(c: &mut Criterion) { | ||||
|     c.bench_function("multithreaded", |b| b.iter(|| run())); | ||||
|     c.bench_function("multithreaded", |b| b.iter(run)); | ||||
| } | ||||
|  | ||||
| criterion_group!(benches, criterion_benchmark); | ||||
|   | ||||
| @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; | ||||
| use onebrc::implementations::multi_threaded_smol::run; | ||||
|  | ||||
| pub fn criterion_benchmark(c: &mut Criterion) { | ||||
|     c.bench_function("multithreadedsmol", |b| b.iter(|| run())); | ||||
|     c.bench_function("multithreadedsmol", |b| b.iter(run)); | ||||
| } | ||||
|  | ||||
| criterion_group!(benches, criterion_benchmark); | ||||
|   | ||||
| @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; | ||||
| use onebrc::implementations::phcs::run; | ||||
|  | ||||
| pub fn criterion_benchmark(c: &mut Criterion) { | ||||
|     c.bench_function("phcs", |b| b.iter(|| run())); | ||||
|     c.bench_function("phcs", |b| b.iter(run)); | ||||
| } | ||||
|  | ||||
| criterion_group!(benches, criterion_benchmark); | ||||
|   | ||||
| @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; | ||||
| use onebrc::implementations::reference_impl::run; | ||||
|  | ||||
| pub fn criterion_benchmark(c: &mut Criterion) { | ||||
|     c.bench_function("reference", |b| b.iter(|| run())); | ||||
|     c.bench_function("reference", |b| b.iter(run)); | ||||
| } | ||||
|  | ||||
| criterion_group!(benches, criterion_benchmark); | ||||
|   | ||||
| @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; | ||||
| use onebrc::implementations::single_thread::run; | ||||
|  | ||||
| pub fn criterion_benchmark(c: &mut Criterion) { | ||||
|     c.bench_function("singlethread", |b| b.iter(|| run())); | ||||
|     c.bench_function("singlethread", |b| b.iter(run)); | ||||
| } | ||||
|  | ||||
| criterion_group!(benches, criterion_benchmark); | ||||
|   | ||||
| @@ -12,7 +12,7 @@ pub struct Mmap<'a> { | ||||
|  | ||||
| /// To properly dispose of the mmap we have to manually call munmap. | ||||
| /// So implementing drop for this smart-pointer type is necessary. | ||||
| impl<'a> Drop for Mmap<'a> { | ||||
| impl Drop for Mmap<'_> { | ||||
|     fn drop(&mut self) { | ||||
|         unsafe { | ||||
|             munmap( | ||||
| @@ -25,7 +25,7 @@ impl<'a> Drop for Mmap<'a> { | ||||
|  | ||||
| // anti-pattern for non-smart pointer types. | ||||
| // ref: https://rust-unofficial.github.io/patterns/anti_patterns/deref.html | ||||
| impl<'a> Deref for Mmap<'a> { | ||||
| impl Deref for Mmap<'_> { | ||||
|     type Target = [u8]; | ||||
|  | ||||
|     fn deref(&self) -> &Self::Target { | ||||
| @@ -50,7 +50,7 @@ impl<'a> Mmap<'a> { | ||||
|             // We can advise the kernel on how we intend to use the mmap. | ||||
|             // But this did not improve my read performance in a meaningful way | ||||
|             madvise(m, size, MADV_WILLNEED); | ||||
|             return Self::new(std::slice::from_raw_parts(m as *const u8, size)); | ||||
|             Self::new(std::slice::from_raw_parts(m as *const u8, size)) | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user