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

Remove duplicated copy of test_perf.hpp #1508

Merged
merged 4 commits into from
May 5, 2022

Conversation

LaurentiuCristofor
Copy link
Contributor

This ensures that we don't end up with diverging copies, as we make updates to these helpers.

using namespace gaia::common;
using namespace gaia::direct_access;
using namespace gaia::perf_basic;
Copy link
Contributor

@senderista senderista May 5, 2022

Choose a reason for hiding this comment

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

Shouldn't this namespace (and similar) be under gaia::benchmark?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the DAC namespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@simone-gaia is right. I don't think there is a way to shove in a benchmark name in there. The namespace seems to be derived from the database name.

@@ -106,7 +112,7 @@ class accumulator_t

double_t percentage_difference(size_t expr, size_t plain)
{
return static_cast<double_t>(expr - plain) / static_cast<double_t>(plain) * 100.0;
return static_cast<double_t>(expr) - static_cast<double_t>(plain) / static_cast<double_t>(plain) * 100.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need parentheses around the whole numerator. I would also add parentheses around the whole fraction itself to clarify that the factor 100 is multiplying the rest of the expression.

Copy link
Contributor

Choose a reason for hiding this comment

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

I.e. ((static_cast<double_t>(expr) - static_cast<double_t>(plain)) / static_cast<double_t>(plain)) * 100.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good points, good catch! I'll do this in next commit!

Copy link
Contributor

@senderista senderista 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 couple comments on parens and namespaces.

Copy link
Contributor

@simone-gaia simone-gaia left a comment

Choose a reason for hiding this comment

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

LGTM

@LaurentiuCristofor LaurentiuCristofor merged commit b7b8f79 into master May 5, 2022
@LaurentiuCristofor LaurentiuCristofor deleted the laur_test_perf_dup branch May 5, 2022 21:56
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.

3 participants