Skip to content

Commit db7c602

Browse files
feat(fil-proofs-tooling): add logging to the benchy command
1 parent b40d12a commit db7c602

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

fil-proofs-tooling/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ heim = "0.0.5"
3737
futures-preview = "0.3.0-alpha.17"
3838
raw-cpuid = "6.1.0"
3939
blake2s_simd = "0.5.6"
40+
pretty_env_logger = "0.3.1"
41+
log = "0.4.8"

fil-proofs-tooling/src/bin/benchy/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ mod hash_fns;
77
mod zigzag;
88

99
fn main() {
10+
pretty_env_logger::init_timed();
11+
1012
let zigzag_cmd = SubCommand::with_name("zigzag")
1113
.about("Run zigzag sealing")
1214
.arg(
@@ -126,7 +128,6 @@ fn main() {
126128
Ok(())
127129
.and_then(|_| {
128130
let layers = value_t!(m, "layers", usize)?;
129-
130131
zigzag::run(zigzag::RunOpts {
131132
bench: m.is_present("bench"),
132133
bench_only: m.is_present("bench-only"),

fil-proofs-tooling/src/bin/benchy/zigzag.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
use cpu_time::ProcessTime;
21
use std::fs::{File, OpenOptions};
32
use std::time::{Duration, Instant};
43
use std::{io, u32};
54

65
use bellperson::Circuit;
76
use chrono::Utc;
7+
use cpu_time::ProcessTime;
88
use failure::bail;
99
use fil_sapling_crypto::jubjub::JubjubBls12;
10+
use log::info;
1011
use memmap::MmapMut;
1112
use memmap::MmapOptions;
1213
use paired::bls12_381::Bls12;
@@ -542,6 +543,8 @@ pub fn run(opts: RunOpts) -> Result<(), failure::Error> {
542543
taper_layers: opts.taper_layers,
543544
};
544545

546+
info!("Benchy ZigZag: {:?}", &params);
547+
545548
let report = match params.hasher.as_ref() {
546549
"pedersen" => generate_report::<PedersenHasher>(params)?,
547550
"sha256" => generate_report::<Sha256Hasher>(params)?,

0 commit comments

Comments
 (0)