From d2d07566e7b9089d7cfc553ce2bc67616474e851 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 5 Sep 2023 21:41:56 +0800 Subject: [PATCH] fix: replace to use `serde_json::to_writer` for performance (#258) Fix to use `serde_json::to_writer`. --- prover/src/io.rs | 2 +- prover/src/proof.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prover/src/io.rs b/prover/src/io.rs index c75402311..01d45925e 100644 --- a/prover/src/io.rs +++ b/prover/src/io.rs @@ -157,7 +157,7 @@ pub fn serialize_verify_circuit_final_pair(pair: &(G1Affine, G1Affine, Vec)) pub fn write_snark(file_path: &str, snark: &Snark) { let mut fd = std::fs::File::create(file_path).unwrap(); - serde_json::to_writer_pretty(&mut fd, snark).unwrap() + serde_json::to_writer(&mut fd, snark).unwrap() } pub fn load_snark(file_path: &str) -> anyhow::Result> { diff --git a/prover/src/proof.rs b/prover/src/proof.rs index e7aee459a..8212c8118 100644 --- a/prover/src/proof.rs +++ b/prover/src/proof.rs @@ -118,7 +118,7 @@ impl Proof { pub fn dump_as_json(dir: &str, filename: &str, proof: &P) -> Result<()> { // Write full proof as json. let mut fd = File::create(dump_proof_path(dir, filename))?; - serde_json::to_writer_pretty(&mut fd, proof)?; + serde_json::to_writer(&mut fd, proof)?; Ok(()) }