I have a Fixture which returns number of experiments:
std::vector<celero::TestFixture::ExperimentValue> getExperimentValues() const override
{
// Problem space as number of points (pairs of X/Y)
std::vector<celero::TestFixture::ExperimentValue> v;
v.emplace_back(1, 0);
v.emplace_back(256, 0);
v.emplace_back(512, 0);
v.emplace_back(1024, 0);
return v;
}
The baseline and other benchmarks are defined similarly to this::
BASELINE_F(wkt, to_string, Fixture, 0, 0)
{
for (auto const& p : this->points_)
{
celero::DoNotOptimizeAway(std::to_string(p.x()));
celero::DoNotOptimizeAway(std::to_string(p.y()));
}
}
Consider this output, where subsequent sizes of problem space receive unexpected number of iterations, 0 leading to division by zero or similar:
where first experiment always gets the number of iterations calculated by Celero, 262144 instead of pre-calculated 16, but subsequent experiments within a set get the iterations from the getExoerimentValues spec.
I'm confused, is the preference of 0 from BASELINE_F for the first experiment an expected behaviour?
Bug Report
I have a
Fixture
which returns number of experiments:The baseline and other benchmarks are defined similarly to this::
Consider this output, where subsequent sizes of problem space receive unexpected number of iterations,
0
leading to division by zero or similar:If I change the
getExperimentValues
to readand I keep the
BASELINE_F(wkt, to_string, Fixture, 0, 0)
, then I get thiswhere first experiment always gets the number of iterations calculated by Celero,
262144
instead of pre-calculated16
, but subsequent experiments within a set get the iterations from thegetExoerimentValues
spec.I'm confused, is the preference of
0
fromBASELINE_F
for the first experiment an expected behaviour?