From 3facfafe8318911c1a03c54d2188564ee0298ca0 Mon Sep 17 00:00:00 2001 From: poma Date: Mon, 13 Apr 2020 17:43:15 +0300 Subject: [PATCH] speed up json read --- phase2/src/circom_circuit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phase2/src/circom_circuit.rs b/phase2/src/circom_circuit.rs index b760dfd..cae11fe 100644 --- a/phase2/src/circom_circuit.rs +++ b/phase2/src/circom_circuit.rs @@ -4,7 +4,7 @@ extern crate rand; use std::str; use std::fs; use std::fs::{OpenOptions, File}; -use std::io::{Read, Write}; +use std::io::{Read, Write, BufReader}; use std::collections::BTreeMap; use std::iter::repeat; use std::sync::Arc; @@ -334,7 +334,7 @@ pub fn circuit_from_json_file(filename: &str) -> CircomCircuit:: { .read(true) .open(filename) .expect("unable to open."); - return circuit_from_json(reader); + return circuit_from_json(BufReader::new(reader)); } pub fn circuit_from_json(reader: R) -> CircomCircuit:: {