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

Refactored Benchmark flag and processing of command line arguments. #73

Merged
merged 10 commits into from
Jun 4, 2021

Conversation

Sqeaky
Copy link
Member

@Sqeaky Sqeaky commented Apr 4, 2021

There is now more metadata, making it easier to make complex decisions in the future.

I added an Isolated Test Group which we should use for stable, short running tests, and seperated it from the the Benchmark Test Group, which is for tests that can pass or fail purely performance measures.

There is now more metadata, making it easier to make complex decisions
in the future.
@Sqeaky Sqeaky added this to the PreJagatiSprint milestone Apr 4, 2021
Comment on lines 108 to 110
Mezzanine::String::size_type LongestName = std::max_element(TestGroups.cbegin(),TestGroups.cend(),
[](const auto& Left, const auto& Right){ return Left.first.size() < Right.first.size(); }
)->first.size();
Copy link
Member

Choose a reason for hiding this comment

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

I get it, but this took a few passes to read.

Copy link
Member Author

Choose a reason for hiding this comment

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

There were 3 of these loop to std::algo changes. All were suggested by CppCheck as I was grasping at straws for the msvc premature test termination. Now that all our compilers support c++17 I saw no reason not to use std::max_element

Copy link
Member

Choose a reason for hiding this comment

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

It's not even that you are using std::max_element, although I suppose that is a small part of it. It's just that it, plus a lambda, plus a dereference in a single statement isn't a trivial read with how it is laid out.

Comment on lines 72 to 75
Mezzanine::String Results(StringToConvert);
std::transform(StringToConvert.begin(), StringToConvert.end(), Results.begin(),
[](ViewChar Letter) -> StringChar { return static_cast<StringChar>(tolower(Letter)); }
);
Copy link
Member

Choose a reason for hiding this comment

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

Why the change from reserve + 1 loop?

Copy link
Member Author

Choose a reason for hiding this comment

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

Another CppCheck inspired change. I need a destination with the correct size, and reserve allocation was not working. It gets the space, but the range isn't for iteration.

This is the one of the three I am least satisfied and I could see refactoring again, now that I figured out the problem I was having was all about reference expiry in the calling table and that is totally resolved now.

@Sqeaky
Copy link
Member Author

Sqeaky commented Jun 2, 2021

I made the formatting better for each of the calls to an std algorithm and removed the double pass in that one part.

@MakoEnergy MakoEnergy merged commit 8080435 into master Jun 4, 2021
@MakoEnergy MakoEnergy deleted the Feature-TestGroupRefactor branch June 4, 2021 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants