| author | |
| committer | |
| log | 3d2698e42b763a8b291c546360efcf2512995fa2 |
| tree | e0a593b332a623f9893cc47371466f279188ca6d |
| parent | f91a8cd65409195aa7bbe74edca1e47f928092a3 |
| signature | Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU |
The listing kept after each refresh was serialized straight into its file, one
write per token. Deleting the Empty section of the corpus notebook
m6/native-features-01 on the iPad simulator (debug build) held the notebook for
about 14.5 s, sampled inside keep_listing's serde writes; written whole, the
same step took under 1.5 s, the scripted run's next step landing on time.
- Deleting, moving and restoring sections no longer pause for seconds.
Assisted-by: claude-opus-5.51 files changed, 2 insertions(+), 1 deletions(-)
crates/notebook/src/session.rs+2-1| ... | ... | @@ -627,7 +627,8 @@ impl Notebook { |
| 627 | 627 | let _ = (|| -> Result<()> { |
| 628 | 628 | let folder = self.listing.parent().unwrap_or(Path::new(".")); |
| 629 | 629 | let mut file = tempfile::NamedTempFile::new_in(folder)?; |
| 630 | serde_json::to_writer(&mut file, &self.read).map_err(io::Error::from)?; | |
| 630 | // Whole, as a write per token takes seconds. | |
| 631 | file.write_all(&serde_json::to_vec(&self.read).map_err(io::Error::from)?)?; | |
| 631 | 632 | file.persist(&self.listing).map_err(|error| error.error)?; |
| 632 | 633 | Ok(()) |
| 633 | 634 | })(); |