Use ndarray's parallelism features
It's easier to read, and it also gets 10-30% perf improvement for Driver::step
This commit is contained in:
@@ -291,10 +291,15 @@ impl MultiRenderer {
|
||||
|
||||
pub fn render(&mut self, state: &SimState, measurements: &[Box<dyn AbstractMeasurement>]) {
|
||||
let max_width = 1980; //< TODO: make configurable
|
||||
// let max_width = 200;
|
||||
let dec = (state.width() + max_width - 1) / max_width;
|
||||
let snap = state.snapshot(dec);
|
||||
Renderer::render(self, &snap, measurements);
|
||||
//let max_width = 100;
|
||||
if state.width() > max_width {
|
||||
let dec = (state.width() + max_width - 1) / max_width;
|
||||
let snap = state.snapshot(dec);
|
||||
// XXX: measurements are messed up by rescaling
|
||||
Renderer::render(self, &snap, &[]);
|
||||
} else {
|
||||
Renderer::render(self, &state.snapshot(1), measurements);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user