You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have a design question about the Sudoku example.
While building the target muduo/examples/sudoku/batch.cc, I noticed:
verify() always returns true:
boolverify(const string& result)
{
returntrue;
}
In runLocal(), succeed is incremented but never used:
voidrunLocal(std::istream& in)
{
Timestamp start(Timestamp::now());
std::string line;
int count = 0;
int succeed = 0;
while (getline(in, line))
{
if (line.size() == implicit_cast<size_t>(kCells))
{
++count;
if (verify(solveSudoku(line)))
{
++succeed;
}
}
}
double elapsed = timeDifference(Timestamp::now(), start);
printf("%.3f sec, %.3f us per sudoku.\n", elapsed, 1000 * 1000 * elapsed / count);
}
On my setup (with warnings treated as errors), this triggers:
error: variable 'succeed' set but not used [-Werror,-Wunused-but-set-variable]
My questions:
Is verify() intentionally a placeholder?
If yes, what kind of verification was intended here?
Is the intended philosophy for batch/pipeline/loadtest to be “pure performance benchmark first” (minimal validation), or should correctness verification be part of the benchmark client?
Would you prefer removing succeed, printing it, or implementing verify in this example?
I am mostly trying to understand the original intent of this example design. Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have a design question about the Sudoku example.
While building the target
muduo/examples/sudoku/batch.cc, I noticed:verify() always returns true:
In runLocal(), succeed is incremented but never used:
On my setup (with warnings treated as errors), this triggers:
My questions:
succeed, printing it, or implementing verify in this example?I am mostly trying to understand the original intent of this example design. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions