-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
There is now more metadata, making it easier to make complex decisions in the future.
src/ConsoleLogic.cpp
Outdated
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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
src/StringManipulation.cpp
Outdated
Mezzanine::String Results(StringToConvert); | ||
std::transform(StringToConvert.begin(), StringToConvert.end(), Results.begin(), | ||
[](ViewChar Letter) -> StringChar { return static_cast<StringChar>(tolower(Letter)); } | ||
); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
I made the formatting better for each of the calls to an std algorithm and removed the double pass in that one part. |
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.