Compare commits
2 Commits
5d9e180817
...
af6cda7349
| Author | SHA1 | Date | |
|---|---|---|---|
| af6cda7349 | |||
| 12da8b2d16 |
@ -122,6 +122,7 @@ fn main() -> Result<(), std::io::Error> {
|
||||
.unwrap();
|
||||
let start_time: DateTime<Utc> = Utc::now();
|
||||
let opt = Opt::from_args();
|
||||
info!("{:?}", opt);
|
||||
let scene = opt.model.scene(&opt);
|
||||
fs::create_dir_all(&opt.output)?;
|
||||
if opt.pprof.is_some() && !cfg!(feature = "profile") {
|
||||
|
||||
@ -139,10 +139,10 @@ pub struct Opt {
|
||||
)]
|
||||
pub push_gateway: String,
|
||||
/// Image width
|
||||
#[structopt(short = "w", long = "width", default_value = "1024")]
|
||||
#[structopt(short = "w", long = "width", default_value = "512")]
|
||||
pub width: usize,
|
||||
/// Image height
|
||||
#[structopt(short = "h", long = "height", default_value = "1024")]
|
||||
#[structopt(short = "h", long = "height", default_value = "512")]
|
||||
pub height: usize,
|
||||
/// Number of threads
|
||||
#[structopt(short = "t", long = "num_threads")]
|
||||
@ -474,6 +474,7 @@ pub fn render(scene: Scene, output_dir: &Path) -> std::result::Result<(), std::i
|
||||
drop(pixel_req_rx);
|
||||
drop(pixel_resp_tx);
|
||||
|
||||
let start_time = time::Instant::now();
|
||||
let (w, h) = (scene.width, scene.height);
|
||||
thread::spawn(move || {
|
||||
let batch_line_requests = true;
|
||||
@ -548,5 +549,16 @@ pub fn render(scene: Scene, output_dir: &Path) -> std::result::Result<(), std::i
|
||||
}
|
||||
}
|
||||
}
|
||||
let human = human::Formatter::new();
|
||||
let time_diff = time::Instant::now() - start_time;
|
||||
let ray_count = RAY_COUNT.load(Ordering::SeqCst);
|
||||
info!(
|
||||
"{} pixels {} {}s pixels/s {} rays/s",
|
||||
human.format(pixel_total as f64),
|
||||
time_diff.as_secs_f64(),
|
||||
human.format(pixel_total as f64 / time_diff.as_secs_f64()),
|
||||
human.format(ray_count as f64 / time_diff.as_secs_f64())
|
||||
);
|
||||
|
||||
output::write_images(output_dir)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user