-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: Remove expensive call to find matching in children (#66)
During the merge process, given two nodes, left and right, we need to iterate over their children to determine how to merge them. In each iteration, we try to find a match for the current left child among the right children and vice versa. Previously, we were examining all captured matches across the entire program tree, which was heavily inefficient. This PR changes the implementation to only consider the matches captured in the other node's children, significantly reducing the number of iterations required. Initial observations in empirical scenarios showed a performance boost of nearly 3x.
- Loading branch information
Showing
3 changed files
with
29 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters