I only added two lines (539 and 540) that give 3x speed gain.
When looking for a swap during hill climbing. We can avoid computing the swap gain if none of the swapped mappings is in the candidate mappings. This will not hurt the search since such a mapping can never contribute to a gain in the score. Also, all optimal mapping will still be reachable even if this swap's gain is not computed/considered.
Doing this change makes the algorithm up to 3x faster for me on AMR2.0 dev.
This change has never affected the smatch score in my test runs. Also, I can not see a way how it can possibly affect the smatch one way or the other.
I only added two lines (539 and 540) that give 3x speed gain.
When looking for a swap during hill climbing. We can avoid computing the swap gain if none of the swapped mappings is in the candidate mappings. This will not hurt the search since such a mapping can never contribute to a gain in the score. Also, all optimal mapping will still be reachable even if this swap's gain is not computed/considered.
Doing this change makes the algorithm up to 3x faster for me on AMR2.0 dev.
This change has never affected the smatch score in my test runs. Also, I can not see a way how it can possibly affect the smatch one way or the other.