add some more caching around the state file & geometry calculations

able to process a simulation in ~2 seconds in the optimistic path
This commit is contained in:
2022-02-01 18:31:47 -08:00
parent f0ab5ea29d
commit 0e98f8582a
3 changed files with 86 additions and 55 deletions

View File

@@ -561,6 +561,8 @@ impl<S: SampleableSim> Renderer<S> for MultiRenderer<S> {
#[derive(Serialize, Deserialize)]
pub struct SerializedFrame<S=StaticSim> {
pub state: S,
/// although not generally necessary to load the sim, saving the measurements is beneficial for
/// post-processing.
pub measurements: Vec<Box<dyn AbstractMeasurement>>,
}
@@ -588,8 +590,8 @@ impl SerializerRenderer {
}
}
/// Same as `new`, but cast to StaticSim before serializing. This tends to result in a smaller
/// file.
/// Same as `new`, but cast to StaticSim before serializing. This yields a file that's easier
/// for post-processing, and may be smaller in size.
pub fn new_static(fmt_str: &str) -> Self {
Self {
fmt_str: fmt_str.into(),