mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-14 06:31:41 +00:00
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.