Severity: low
Location: src-tauri/src/screenplay/pdf.rs:116-192 (group_elements and surroundings)
group_elements() clones element_type, text, and typst_inline for every element. For a 120-scene screenplay with ~2000 nodes, that duplicates several megabytes of string data during PDF generation.
This isn't on the editor hot path (export is a one-shot operation) but it does show up in export latency for long scripts.
Fix: Take the input by &[Element] and emit groups holding references with explicit lifetimes; or, since elements aren't reused after grouping, swap clone() for mem::take() / move semantics on the source vec.
Severity: low
Location:
src-tauri/src/screenplay/pdf.rs:116-192(group_elementsand surroundings)group_elements()cloneselement_type,text, andtypst_inlinefor every element. For a 120-scene screenplay with ~2000 nodes, that duplicates several megabytes of string data during PDF generation.This isn't on the editor hot path (export is a one-shot operation) but it does show up in export latency for long scripts.
Fix: Take the input by
&[Element]and emit groups holding references with explicit lifetimes; or, since elements aren't reused after grouping, swapclone()formem::take()/ move semantics on the source vec.