Files
vectorcraft/crates/engine/src/cmd/threads
dotCooCoo d9c1f4335e Threaded Text: thread edits find frames and threads in one pass
Several threaded-text paths in threads.rs searched a list once for each
frame, so their work grew with the product of the frame count and the
list length:

- leave_threads (Create Outlines, Expand Appearance, Rasterize, Flatten
  Transparency, symbol replacement, opening with text as outlines)
  searched the threads for each frame that stayed and ran continued over
  that frame's whole thread again, about n^2 frame visits for a thread of
  n frames. It now marks each changed thread with one continued call,
  and keeps the frames that left in a map instead of a list.
- has_thread_selection (the availability of Release Selection and Remove
  Threading), with_threads, keep_shown_text and cut_to_shown, release and
  remove test ids against a hash set instead of a list.
- create finds the thread of each selected frame from a table built
  once, and each frame still takes in the first thread not yet merged
  that lists it.
- release writes each thread back at its own index instead of searching
  the thread list for an equal thread.

Marks, thread membership, frame order, text and overflow are unchanged.

A 256-frame thread that loses one frame visited 65,025 frames before
this change and at most 256 now. Six tests on many threads count the set
lookups: with a list in place of the set they make 67,650 to 258,226.
Another test compares the marks with a scan of the frames before each
one.
2026-11-13 11:40:39 -08:00
..