Compare commits

..

2 Commits

Author SHA1 Message Date
853eead617 improved simulation for multiple samples 2024-06-06 11:21:34 +02:00
bcf0430bf6 reduced optimization for performance 2024-06-06 11:20:41 +02:00
2 changed files with 7 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ path = "src/main.rs"
[profile.release] [profile.release]
strip = true # Automatically strip symbols from the binary. strip = true # Automatically strip symbols from the binary.
opt-level = 3 opt-level = 2
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -15,7 +15,8 @@ mod function;
mod plot; mod plot;
const THREAD_CNT: usize = 20; const THREAD_CNT: usize = 20;
const SAMPLE_LIMIT: usize = 100_000_000; const SAMPLE_START: usize = 100_000_000_000;
const SAMPLE_LIMIT: usize = 1_000_000_000_000;
const SUB_SAMPLES: [usize; 3] = [1, 2, 5]; const SUB_SAMPLES: [usize; 3] = [1, 2, 5];
const SAMPLES_PER_ITERATION: usize = 250; const SAMPLES_PER_ITERATION: usize = 250;
@@ -49,11 +50,13 @@ fn simulate(bounds: &Bounds, func: &Function) {
} }
sample_cnt *= 10; sample_cnt *= 10;
let file: io::Result<File> = File::create(format!("output{}.json", sample_cnt.ilog10())); let file: io::Result<File> = File::create(format!("out/output{}.json", sample_cnt.ilog10()));
if file.is_err() { if file.is_err() {
panic!("Error creating output file") panic!("Error creating output file")
} }
if let Err(_) = file.unwrap().write(result.to_json().to_string().as_bytes()) { panic!("Error writing to file") }; if let Err(_) = file.unwrap().write(result.to_json().to_string().as_bytes()) { panic!("Error writing to file") };
result = Plot::new();
} }
} }