comparison · c_8337e9dd0f87 (tommy-mor) vs c_a28a6860976d (tommy-mor)
B is a substantive algorithmic refactor that replaces an O(n²) sort-based pairing scheme with a simpler linear-scan approach, preserving behavior (tests kept, semantics documented) while improving performance and reducing complex enum/sort-key machinery. A is a small, valid concurrency fix (releasing a read lock earlier to avoid writer starvation) but is narrower in scope and impact compared to B's broader design simplification with performance benefits.
B replaces an O(n²) candidate-sort that re-derived rank-centrality keys per pair with linear attach/bridge growth plus a single zip pass after one RC order, which is a lasting core-algorithm and scalability fix. A correctly drops the Tokio read guard before layout so writers are not blocked, but that is a localized locking hygiene fix on one handler versus B’s broader complexity and performance win.
Side B substantially redesigns the pair-selection algorithm by replacing per-candidate priority/key computation with a staged approach: linear graph-growth scans (`suggest_grow_pair`), a single rank-centrality pass with adjacent-rank zipping (`zip_adjacent_pair`), and simplified fallback logic. This removes the previous O(n²)-style ranking work while preserving behavior through targeted helper functions, whereas Side A is a focused concurrency improvement that simply precomputes `room_members_section_markup` and drops an `RwLock` read guard before expensive HTML rendering to reduce lock contention.
comparison · c_a28a6860976d (tommy-mor) vs c_7d1184e70fad (tommy-mor)
A is a clean refactor that replaces an O(n^2) sort-key approach with equivalent linear-scan logic, mostly reorganizing existing behavior without changing outcomes. B builds directly on A's structure and fixes a real behavioral flaw (always picking the same established endpoint, creating hub bias) by randomizing attach/bridge target selection, which is a substantive correctness/fairness improvement to the algorithm's actual output.
A is a structural redesign: it drops the all-pairs sort-key machinery (PairPriority/BridgeSubPriority/WithinSubPriority and repeated ranked_pool_order work) for linear grow scans plus a single zip-adjacent RC pass once connected, which is both a real complexity/perf fix and lasting simplification. B only refines A's grow path by shuffling isolates and sampling random endpoints in the largest component—useful fairness tweaking, but incremental on top of A's design.
Side A substantially redesigns pair selection by removing the generic priority/sort-key machinery, avoiding repeated rank-centrality work until the pool is fully connected, and splitting the logic into targeted growth and adjacent-rank zip passes. Side B is an incremental improvement on top of that design, adding randomized endpoint selection from the largest established component to reduce deterministic attachment bias, but it does not change the core algorithm as significantly.