Skip to content

Commit 86cb0d1

Browse files
committed
Added documentation for the functions and structs.
1 parent 98c5aed commit 86cb0d1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test_suite/src/bench.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,23 @@ use serde_json::Value;
66

77
use crate::constants;
88

9+
/// Error that may happen in the command execution.
910
#[derive(thiserror::Error, Debug)]
1011
pub enum Error {
1112
#[error("error executing the gate-count command: {0:?}")]
1213
CommandOutputError(String),
1314
}
1415

16+
/// Results of the benchmark.
17+
///
18+
/// This results are extracted using the command `bb gates -b <target>`
1519
#[derive(Deserialize)]
1620
pub struct BenchResult {
21+
/// Number of ACIR opcodes generated by the compiler.
1722
pub acir_opcodes: u32,
23+
/// The number of gates.
1824
pub circuit_size: u32,
25+
/// Number of gates per opcode.
1926
pub gates_per_opcode: Vec<u32>,
2027
}
2128

@@ -29,6 +36,9 @@ impl Display for BenchResult {
2936
}
3037
}
3138

39+
/// Executes the command to count the gate. This command must be executed after
40+
/// the code is successfully compiled. To count the number of gates, we use the
41+
/// command `bb gates -b <target>`.
3242
pub fn execute_count_gate_command() -> anyhow::Result<BenchResult> {
3343
let output = Command::new("bb")
3444
.args(["gates", "-b"])

0 commit comments

Comments
 (0)