This is an automated email from the ASF dual-hosted git repository.
kriskras99 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro-rs.git
The following commit(s) were added to refs/heads/main by this push:
new b6e157f chore: Delete a benchmark test for serde_json (#446)
b6e157f is described below
commit b6e157fe56d3a555e8e86cf720426c546da2aa67
Author: Martin Grigorov <[email protected]>
AuthorDate: Tue Jan 27 23:15:41 2026 +0200
chore: Delete a benchmark test for serde_json (#446)
There is nothing related to Avro in this bench test
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---
avro/Cargo.toml | 4 ---
avro/benches/serde_json.rs | 77 ----------------------------------------------
2 files changed, 81 deletions(-)
diff --git a/avro/Cargo.toml b/avro/Cargo.toml
index 08fcb6a..a00ee1c 100644
--- a/avro/Cargo.toml
+++ b/avro/Cargo.toml
@@ -44,10 +44,6 @@ path = "src/lib.rs"
harness = false
name = "serde"
-[[bench]]
-harness = false
-name = "serde_json"
-
[[bench]]
harness = false
name = "single"
diff --git a/avro/benches/serde_json.rs b/avro/benches/serde_json.rs
deleted file mode 100644
index e6f96e6..0000000
--- a/avro/benches/serde_json.rs
+++ /dev/null
@@ -1,77 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-use criterion::{Criterion, criterion_group, criterion_main};
-use serde_json::Value;
-use std::collections::HashMap;
-
-fn make_big_json_record() -> Value {
- let address = HashMap::<_, _>::from_iter(vec![
- ("street", "street"),
- ("city", "city"),
- ("state_prov", "state_prov"),
- ("country", "country"),
- ("zip", "zip"),
- ]);
- let address_json = serde_json::to_value(address).unwrap();
- let big_record = HashMap::<_, _>::from_iter(vec![
- ("username", serde_json::to_value("username").unwrap()),
- ("age", serde_json::to_value(10i32).unwrap()),
- ("phone", serde_json::to_value("000000000").unwrap()),
- ("housenum", serde_json::to_value("0000").unwrap()),
- ("address", address_json),
- ]);
- serde_json::to_value(big_record).unwrap()
-}
-
-fn write_json(records: &[Value]) -> Vec<u8> {
- serde_json::to_vec(records).unwrap()
-}
-
-fn read_json(bytes: &[u8]) {
- let reader: serde_json::Value = serde_json::from_slice(bytes).unwrap();
- for record in reader.as_array().unwrap() {
- let _ = record;
- }
-}
-
-fn bench_read_json(
- c: &mut Criterion,
- make_record: impl Fn() -> Value,
- n_records: usize,
- name: &str,
-) {
- let records = std::iter::repeat_n(make_record(),
n_records).collect::<Vec<_>>();
- let bytes = write_json(&records);
- c.bench_function(name, |b| b.iter(|| read_json(&bytes)));
-}
-
-fn bench_big_schema_json_read_10_000_record(c: &mut Criterion) {
- bench_read_json(
- c,
- make_big_json_record,
- 10_000,
- "big schema, read 10k JSON records",
- );
-}
-
-criterion_group!(
- name = benches;
- config = Criterion::default().sample_size(10);
- targets = bench_big_schema_json_read_10_000_record,
-);
-criterion_main!(benches);