Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better heuristics for QPs #789

Merged
merged 3 commits into from
Dec 20, 2023
Merged

Better heuristics for QPs #789

merged 3 commits into from
Dec 20, 2023

Conversation

marcoeilers
Copy link
Contributor

Silicon's heuristics for selecting in what order to use QP chunks when exhaling QPs are somewhat lacking (see issue #788).

This PR adds a much more precise kind of heuristics that should help a lot with performance when QPs of the same "shape" (as in, the same number and types of quantified variables) are inhaled and exhaled repeatedly.
E.g., if the QP we're looking to find or remove has a quantified variable i: Int and receiver term f(a, i), and an existing chunk with quantified variable x: Int has receiver term f(g(), x), where a == g(), then that chunk would be selected first. We use the decider to check for equality, so it can take all knowledge Silicon currently has into account.
If no such chunk exists, the standard hint based heuristics are used.

@jcp19
Copy link
Contributor

jcp19 commented Dec 20, 2023

For future reference, my quick and dirty measurements in the master branch of SCION (router package):

  • without this PR: 12:14
  • with this PR: 12:30
    image

@marcoeilers
Copy link
Contributor Author

Haha :D
For the record, I still think this is a good change. It may cause a tiny bit of additional cost for many cases (but should never be really expensive) and helps massively in some cases.

Copy link
Contributor

@jcp19 jcp19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert in this code, but the changes look ok to me. Unfortunately, SCION did not get faster with this :'(

@marcoeilers marcoeilers merged commit 9d7abee into master Dec 20, 2023
4 checks passed
@marcoeilers marcoeilers deleted the meilers_qp_heuristics branch December 20, 2023 20:35
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.

None yet

2 participants