Skip to content

Commit b6e9b45

Browse files
frankmcsherryclaude
andcommitted
Update benchmarks to use indexed module instead of removed Sequence
The bench and serde benchmarks referenced the removed EncodeDecode trait and Sequence type. Updated to use the indexed module directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 02583fc commit b6e9b45

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

benches/bench.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bencher::{benchmark_group, benchmark_main, Bencher};
22
use columnar::{Clear, Columnar};
3-
use columnar::bytes::{EncodeDecode, Sequence};
3+
use columnar::bytes::indexed;
44

55
fn empty_copy(bencher: &mut Bencher) { _bench_copy(bencher, vec![(); 1024]); }
66
fn option_copy(bencher: &mut Bencher) { _bench_copy(bencher, vec![Option::<String>::None; 1024]); }
@@ -61,7 +61,7 @@ fn _bench_copy<T: Columnar+Eq>(bencher: &mut Bencher, record: T) where T::Contai
6161
arena.push(&record);
6262
}
6363
use columnar::Borrow;
64-
bencher.bytes = Sequence::length_in_bytes(&arena.borrow()) as u64;
64+
bencher.bytes = indexed::length_in_bytes(&arena.borrow()) as u64;
6565
arena.clear();
6666

6767
bencher.iter(|| {
@@ -83,7 +83,7 @@ fn _bench_extend<T: Columnar+Eq>(bencher: &mut Bencher, record: T) where T::Cont
8383
arena.push(&record);
8484
}
8585
use columnar::{Borrow, Container};
86-
bencher.bytes = Sequence::length_in_bytes(&arena.borrow()) as u64;
86+
bencher.bytes = indexed::length_in_bytes(&arena.borrow()) as u64;
8787

8888
let arena2 = arena.clone();
8989

benches/serde.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bencher::{benchmark_group, benchmark_main, Bencher};
22
use columnar::{Columnar, Container, Clear, FromBytes};
3-
use columnar::bytes::{EncodeDecode, Sequence};
3+
use columnar::bytes::indexed;
44
use serde::{Serialize, Deserialize};
55

66
fn goser_new(b: &mut Bencher) {
@@ -19,7 +19,7 @@ fn goser_push(b: &mut Bencher) {
1919
container.push(&log);
2020
}
2121
let mut words = vec![];
22-
Sequence::encode(&mut words, &container.borrow());
22+
indexed::encode(&mut words, &container.borrow());
2323
b.bytes = 8 * words.len() as u64;
2424
b.iter(|| {
2525
container.clear();
@@ -50,11 +50,11 @@ fn goser_encode(b: &mut Bencher) {
5050
container.push(&log);
5151
}
5252
let mut words = vec![];
53-
Sequence::encode(&mut words, &container.borrow());
53+
indexed::encode(&mut words, &container.borrow());
5454
b.bytes = 8 * words.len() as u64;
5555
b.iter(|| {
5656
words.clear();
57-
Sequence::encode(&mut words, &container.borrow());
57+
indexed::encode(&mut words, &container.borrow());
5858
bencher::black_box(&words);
5959
});
6060
}
@@ -67,10 +67,10 @@ fn goser_decode(b: &mut Bencher) {
6767
for _ in 0..1024 {
6868
container.push(&log);
6969
}
70-
Sequence::encode(&mut words, &container.borrow());
70+
indexed::encode(&mut words, &container.borrow());
7171
b.bytes = 8 * words.len() as u64;
7272
b.iter(|| {
73-
let mut slices = Sequence::decode(&mut words);
73+
let mut slices = indexed::decode(&mut words);
7474
let foo = <<Log as Columnar>::Container as Container>::Borrowed::from_bytes(&mut slices);
7575
bencher::black_box(foo);
7676
});

0 commit comments

Comments
 (0)