perf: Vectorize O(n²) pairwise contrast check in thread_manager #28
Labels
No labels
blocked:children
blocked:depends-101
blocked:depends-103
blocked:depends-104
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:preflight
bug
chore
feature-request
in-progress
lint-cleanup
needs-decompose
performance
quality
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
thread_manager.py:270— O(n²) nested loop comparing every pair of thread colors for luminance contrast.Proposed Fix
Vectorize with numpy: compute luminance array, then use broadcasting for pairwise differences.
Impact
5-20x faster for thread color palette validation.
Files
src/embroidery_converter/thread_manager.py:260-287