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

Test strash key spread #18

Closed
wants to merge 2 commits into from
Closed

Conversation

ecordell
Copy link

@ecordell ecordell commented Aug 25, 2021

I was curious about ^a<<13 * b as the strash calculation and played with some other options.

It does seem to be the best option, so there's no reason to merge this. Just sharing the work.


This change is Reviewable

@scott-cotton
Copy link
Member

Cool, thanks! I became curious too and did something a bit similar (I counted collisions manually but only tried hashes directly on 2 32bit inputs). Certainly some of those give less collisions no?

But the purpose of the hashing is speed/space optimisation, so I think a cheap hash is appropriate.

BTW, there are some potentially interesting reads on non-hash ways of doing similar optimisations (If you are into that kind of thing...)

@ecordell
Copy link
Author

I tested the new hash with the benchmarks in this PR and it looks like the old one still comes out ahead?

They're all close enough; we may be just testing our own hardware more than the hash at this point.

Thanks for the links - I read through the FRAIGs paper this morning, but the others are new to me!

@scott-cotton
Copy link
Member

scott-cotton commented Aug 25, 2021

I guess there is bias in the test and an exploit of a < b in the shift negate multiply, whereas the others don't care if a < b.

The bias in the test is that the input sizes we are testing are small. If you are bit blasting arithmetic In a program they are much much larger. If you are doing model checking by unrolling of bit-blasting arithmetic, they get even bigger.

I didn't make graphs but the microbenchmarks (on my Mac arm laptop) showed that multiplies hurt: the random 3cnf (100 x 300) would add about 10000 ns per multiply in the hash func for the 3cnf task.

I am curious about whether defining strashCode as a var rather than a func decl has an effect on performance. I guess the compiler might identify that it never changes when no tests are run and it won't matter, but I am not sure, one would have to test without go -test to see.

(BTW if interested in being a submitter into gini or other go-air repos, feel free to
file an issue as per the CoC )

ecordell added a commit to ecordell/operator-lifecycle-manager that referenced this pull request Aug 26, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18
ecordell added a commit to ecordell/operator-lifecycle-manager that referenced this pull request Aug 26, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18
ecordell added a commit to ecordell/operator-lifecycle-manager that referenced this pull request Aug 26, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
openshift-merge-robot pushed a commit to operator-framework/operator-lifecycle-manager that referenced this pull request Aug 26, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
@scott-cotton
Copy link
Member

@ecordell Thanks much for the PR. Feel free to come back anytime for any reason -- I'm happy to see reference to gini in the operator-lifecycle-manager.

(closing)

ankitathomas pushed a commit to ankitathomas/operator-framework-olm that referenced this pull request Sep 8, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
ankitathomas pushed a commit to ankitathomas/operator-framework-olm that referenced this pull request Sep 9, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
timflannagan pushed a commit to timflannagan/operator-framework-olm that referenced this pull request Sep 28, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
timflannagan pushed a commit to timflannagan/operator-framework-olm that referenced this pull request Sep 28, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
timflannagan pushed a commit to timflannagan/operator-framework-olm that referenced this pull request Sep 29, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
timflannagan pushed a commit to timflannagan/operator-framework-olm that referenced this pull request Sep 29, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
timflannagan pushed a commit to timflannagan/operator-framework-olm that referenced this pull request Oct 13, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
njhale pushed a commit to njhale/operator-framework-olm that referenced this pull request Oct 13, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
timflannagan pushed a commit to njhale/operator-framework-olm that referenced this pull request Nov 15, 2021
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
perdasilva pushed a commit to perdasilva/operator-framework-olm that referenced this pull request Mar 4, 2022
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
perdasilva pushed a commit to perdasilva/operator-framework-olm that referenced this pull request Mar 4, 2022
new version has logic.C performance improvements that should help

see:
- go-air/gini#17
- go-air/gini@3a1a4d9
- go-air/gini@8dd6805
- go-air/gini#18

Signed-off-by: Evan <cordell.evan@gmail.com>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: c20784d3e2a372c2a6a03dbcfedf512ca84b1eca
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