Skip to content

Commit

Permalink
Deduplication, columns, general improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Hoffmann <[email protected]>
  • Loading branch information
antiguru committed Feb 12, 2024
1 parent 949b886 commit d1073a9
Show file tree
Hide file tree
Showing 13 changed files with 1,188 additions and 150 deletions.
20 changes: 16 additions & 4 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

extern crate test;

use flatcontainer::impls::tuple::TupleABCRegion;
use flatcontainer::impls::deduplicate::{CollapseSequence, ConsecutiveOffsetPairs};
use flatcontainer::impls::offsets::OffsetOptimized;
use flatcontainer::impls::tuple::{TupleABCRegion, TupleABRegion};
use flatcontainer::{
Containerized, CopyOnto, CopyRegion, FlatStack, MirrorRegion, Region, ReserveItems,
SliceRegion, StringRegion,
Expand Down Expand Up @@ -80,15 +82,25 @@ fn str100_copy_region(bencher: &mut Bencher) {
}
#[bench]
fn string10_copy_region(bencher: &mut Bencher) {
_bench_copy_region::<SliceRegion<_>, _>(bencher, vec![format!("grawwwwrr!"); 1024]);
_bench_copy_region::<SliceRegion<StringRegion>, _>(bencher, vec![format!("grawwwwrr!"); 1024]);
}
#[bench]
fn string10_copy_region_collapse(bencher: &mut Bencher) {
_bench_copy_region::<
SliceRegion<CollapseSequence<ConsecutiveOffsetPairs<StringRegion>>, OffsetOptimized>,
_,
>(bencher, vec![format!("grawwwwrr!"); 1024]);
}
#[bench]
fn string20_copy_region(bencher: &mut Bencher) {
_bench_copy_region::<SliceRegion<_>, _>(bencher, vec![format!("grawwwwrr!!!!!!!!!!!"); 512]);
_bench_copy_region::<SliceRegion<StringRegion>, _>(
bencher,
vec![format!("grawwwwrr!!!!!!!!!!!"); 512],
);
}
#[bench]
fn vec_u_s_copy_region(bencher: &mut Bencher) {
_bench_copy_region::<SliceRegion<_>, _>(
_bench_copy_region::<SliceRegion<SliceRegion<TupleABRegion<MirrorRegion<_>, StringRegion>>>, _>(
bencher,
vec![vec![(0u64, "grawwwwrr!".to_string()); 32]; 32],
);
Expand Down
Loading

0 comments on commit d1073a9

Please sign in to comment.