Skip to content

Single-pass replace_source / replace_destination - #90

Open
yinoneliraz wants to merge 1 commit into
masterfrom
yinon/replace-source-single-pass
Open

yinoneliraz wants to merge 1 commit into
masterfrom
yinon/replace-source-single-pass

Conversation

@yinoneliraz

Copy link
Copy Markdown
Contributor

Rewrite _replace_source_in_edges and replace_destination as plain single-pass loops (same shape as replace_nodes from CORE-30) instead of composed transform_edges passes, which iterated the edge set four times through curried per-edge closures. Removes the now-unused private edge-mapper helpers.

Benchmark (bot-building workload, 4498 edges, 200 replaces): replace_source phase 2534ms -> 602ms; workload total 3141ms -> 1209ms. All tests pass; canonical output graphs identical to master.

Rewrite _replace_source_in_edges and replace_destination as plain single-pass
loops (same shape as replace_nodes from CORE-30) instead of composed
transform_edges passes, which iterated the edge set four times through
curried per-edge closures. Removes the now-unused private edge-mapper helpers.

Benchmark (bot-building workload, 4498 edges, 200 replaces):
replace_source phase 2534ms -> 602ms; workload total 3141ms -> 1209ms.
All tests pass; canonical output graphs identical to master.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yinoneliraz
yinoneliraz force-pushed the yinon/replace-source-single-pass branch from c96a809 to 90f5aa4 Compare July 12, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants