Skip to content

Commit d0103ac

Browse files
committed
feldera-types: avro: set default workers to 4
Signed-off-by: Abhinav Gyawali <22275402+abhizer@users.noreply.github.com>
1 parent 26e6915 commit d0103ac

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

crates/adapters/benches/avro_encoder.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ fn build_indexed_batch(data: &[BenchTestStruct]) -> Arc<dyn SerBatch> {
207207
.map(|v| Tup2(Tup2(BenchKeyStruct { id: v.id }, v.clone()), 1i64))
208208
.collect();
209209
let zset = OrdIndexedZSet::from_tuples((), tuples);
210-
Arc::new(<SerBatchImpl<_, BenchKeyStruct, BenchTestStruct>>::new(zset))
210+
Arc::new(<SerBatchImpl<_, BenchKeyStruct, BenchTestStruct>>::new(
211+
zset,
212+
))
211213
}
212214

213215
fn build_plain_batch(data: &[BenchTestStruct]) -> Arc<dyn SerBatch> {
@@ -276,9 +278,7 @@ fn bench_indexed_encode(c: &mut Criterion) {
276278
let mut encoder = create_indexed_encoder(workers);
277279
b.iter(|| {
278280
encoder.consumer().batch_start(0);
279-
encoder
280-
.encode(batch.clone().arc_as_batch_reader())
281-
.unwrap();
281+
encoder.encode(batch.clone().arc_as_batch_reader()).unwrap();
282282
encoder.consumer().batch_end();
283283
});
284284
},
@@ -305,9 +305,7 @@ fn bench_indexed_encode_scaling(c: &mut Criterion) {
305305
let mut encoder = create_indexed_encoder(workers);
306306
b.iter(|| {
307307
encoder.consumer().batch_start(0);
308-
encoder
309-
.encode(batch.clone().arc_as_batch_reader())
310-
.unwrap();
308+
encoder.encode(batch.clone().arc_as_batch_reader()).unwrap();
311309
encoder.consumer().batch_end();
312310
});
313311
},
@@ -318,9 +316,5 @@ fn bench_indexed_encode_scaling(c: &mut Criterion) {
318316
group.finish();
319317
}
320318

321-
criterion_group!(
322-
benches,
323-
bench_indexed_encode,
324-
bench_indexed_encode_scaling,
325-
);
319+
criterion_group!(benches, bench_indexed_encode, bench_indexed_encode_scaling,);
326320
criterion_main!(benches);

crates/adapters/src/format/avro/serializer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ where
443443
///
444444
/// Assumes that the `Serialize` implementation driving this serializer is generated by
445445
/// the [`serialize_table_record`](feldera_types::serialize_table_record) macro and configured
446-
/// using [`avro_serde_config`].
446+
/// using [`avro_ser_config`].
447447
///
448448
/// Performs the following transformations on data:
449449
/// - Converts input timestamps and times in microseconds to microseconds or millisecond,

crates/feldera-types/src/format/avro.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub struct AvroEncoderConfig {
254254
///
255255
/// Avro encoder supports encoding multiple records in parallel. This configuration specifies
256256
/// the number of workers to run in parallel.
257-
/// Default: 1
257+
/// Default: 4
258258
#[serde(default = "default_encoder_workers")]
259259
pub workers: usize,
260260
}
@@ -276,5 +276,5 @@ impl Default for AvroEncoderConfig {
276276
}
277277

278278
fn default_encoder_workers() -> usize {
279-
8
279+
4
280280
}

0 commit comments

Comments
 (0)