File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,23 @@ use serde_json::Value;
66
77use crate :: constants;
88
9+ /// Error that may happen in the command execution.
910#[ derive( thiserror:: Error , Debug ) ]
1011pub 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 ) ]
1620pub 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>`.
3242pub fn execute_count_gate_command ( ) -> anyhow:: Result < BenchResult > {
3343 let output = Command :: new ( "bb" )
3444 . args ( [ "gates" , "-b" ] )
You can’t perform that action at this time.
0 commit comments