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

Cleanup #60

Merged
merged 5 commits into from
Jun 12, 2020
Merged

Cleanup #60

merged 5 commits into from
Jun 12, 2020

Conversation

trachten
Copy link
Owner

Some more commits.

… variables. This should be superceded in C++-17 with "optionals".
@novakboskov
Copy link
Collaborator

@trachten There are some compiler errors on your last commit here (869eccd).

Also, do you use any compiler flags other than what is specified in CmakeList.txt? Could you also share the compiler version you use with this project? I see you mention some compiler warnings in some of your commit messages and I'm just wondering if we use different compilers.

@trachten
Copy link
Owner Author

trachten commented Jun 11, 2020 via email

Copy link
Collaborator

@novakboskov novakboskov left a comment

Choose a reason for hiding this comment

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

Just a few questions on try-catch vs if in Cuckoo.

_commit_relocation_chain(relocStack);
itemsCount++;
return true;
}
} catch (overflow_error ignored) {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is within the cuckoo relocations loop.
In mostly full filters (say alpha>80) this exception is going to be thrown a lot. Once per node in the cuckoo graph. That might make our insertions slower.

Is it because of ignored that this will not be much slower? Is it because ignored short-circuits the exception handler traversal?

The two try-catchs above are different, they are called once per insertion.

Copy link
Owner Author

Choose a reason for hiding this comment

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

A good optimizer should optimize them out - see if you can do a quick profile to see whether it is really a problem?

Copy link
Collaborator

@novakboskov novakboskov Jun 12, 2020

Choose a reason for hiding this comment

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

I tried it very naively:

int main() {
    for (size_t ii=0; ii<4000; ii++) {
        Cuckoo c = Cuckoo(7, 4, 1024, 500);
        c.insert(DataObject(ZZ(Cuckoo::_rand(0, 1 << 12))));
    }
}

And, well, Linux perf shows that both if and try-cache (with GCC -O3) spend about the same estimated number of cycles in insert. Plain time says the same...

No significant diference.

src/Syncs/Cuckoo.cpp Show resolved Hide resolved
@novakboskov novakboskov merged commit 025c280 into master Jun 12, 2020
@trachten
Copy link
Owner Author

trachten commented Jun 19, 2020 via email

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