Skip to content

Commit 284b8e6

Browse files
committed
Only plot circuit size if "plot" feature is enabled
1 parent 705815f commit 284b8e6

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ serde = { version = "1.0", features = ["derive"], optional = true }
2626

2727
[features]
2828
bin = ["clap"]
29+
plot = []
2930

3031
[dev-dependencies]
3132
quickcheck = "1"

tests/circuit.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use std::collections::HashMap;
2-
3-
use garble_lang::{compile, compile_with_constants, literal::Literal, token::UnsignedNumType};
1+
use garble_lang::compile;
42

53
#[test]
64
fn optimize_or() -> Result<(), String> {
@@ -172,10 +170,16 @@ pub fn main(arr1: [(u16, u16, u32); 8]) -> [((u16, u16), u32); 8] {
172170
Ok(())
173171
}
174172

173+
// Run the following test using `cargo test plot --features=plot --release -- --nocapture`
174+
175175
#[test]
176+
#[cfg(feature = "plot")]
176177
fn plot_for_each_join_loop_complexity() -> Result<(), String> {
177-
// change this to 1000 and run this test using `cargo test --release` for a full plot
178-
let max_rows = 40;
178+
use garble_lang::{compile_with_constants, literal::Literal, token::UnsignedNumType};
179+
use plotters::prelude::*;
180+
use std::collections::HashMap;
181+
182+
let max_rows = 1000;
179183

180184
let prg_nested_loop = "
181185
const ROWS_0: usize = PARTY_0::ROWS_0;
@@ -246,7 +250,7 @@ pub fn main(rows0: [([u8; 8], u32); ROWS_0], rows1: [([u8; 8], u32); ROWS_1]) ->
246250
}
247251
}
248252
}
249-
use plotters::prelude::*;
253+
250254
let root = SVGBackend::new("plot_for_each_join_loop.svg", (1024, 768)).into_drawing_area();
251255
root.fill(&WHITE).unwrap();
252256
let mut chart = ChartBuilder::on(&root)

0 commit comments

Comments
 (0)