Skip to main content

write_emotions_batch

Function write_emotions_batch 

Source
pub fn write_emotions_batch(
    path: &Path,
    updates: &[(usize, [f32; 21])],
) -> Result<(), String>
Expand description

Write many block emotions with a single read-modify-write.

write_emotion does the whole file per call: read 58.7 MB on the eval index, patch 84 bytes, write 58.7 MB, rename. A recall that blends ten blocks therefore moved about 1.2 GB, which measured as 4.2 s. The file is read once, every update is applied in memory, and the result is written once – same bytes, same atomic temp+rename guarantee, a tenth of the I/O.