Skip to content

Commit e21fccc

Browse files
committed
Bincode vs Protobuf
1 parent a66a9e7 commit e21fccc

File tree

5 files changed

+1734
-526
lines changed

5 files changed

+1734
-526
lines changed

acvm-repo/acir/src/circuit/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ pub mod black_box_functions;
22
pub mod brillig;
33
pub mod opcodes;
44

5-
use crate::{
6-
native_types::{Expression, Witness},
7-
proto::convert::ProtoSchema,
8-
};
5+
use crate::native_types::{Expression, Witness};
96
use acir_field::AcirField;
10-
use noir_protobuf::ProtoCodec as _;
117
pub use opcodes::Opcode;
128
use thiserror::Error;
139

@@ -258,6 +254,8 @@ impl<F: Serialize + AcirField> Program<F> {
258254
// s.take_buffer()
259255

260256
// # Protobuf
257+
use crate::proto::convert::ProtoSchema;
258+
use noir_protobuf::ProtoCodec;
261259
ProtoSchema::<F>::serialize_to_vec(self)
262260
};
263261
let mut encoder = flate2::write::GzEncoder::new(writer, Compression::default());
@@ -290,7 +288,7 @@ impl<F: AcirField + for<'a> Deserialize<'a>> Program<F> {
290288
gz_decoder.read_to_end(&mut buf)?;
291289
let result = {
292290
// # Bincode
293-
//bincode::deserialize(&buf)
291+
// bincode::deserialize(&buf)
294292

295293
// # CBOR
296294
// ciborium::from_reader(buf.as_slice())
@@ -300,6 +298,8 @@ impl<F: AcirField + for<'a> Deserialize<'a>> Program<F> {
300298
// Self::deserialize(r)
301299

302300
// # Protobuf
301+
use crate::proto::convert::ProtoSchema;
302+
use noir_protobuf::ProtoCodec;
303303
ProtoSchema::<F>::deserialize_from_vec(&buf)
304304
};
305305
result.map_err(|err| std::io::Error::new(std::io::ErrorKind::InvalidInput, err))

0 commit comments

Comments
 (0)