google/benchmark

Fail when calculating complexity

Open

#410 ouverte le 30 juin 2017

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)C++ (1 539 forks)batch import
enhancementgood first issuehelp wanted

Métriques du dépôt

Stars
 (7 968 stars)
Métriques de merge PR
 (Merge moyen 4j 2h) (19 PRs mergées en 30 j)

Description

When calculating time complexity and the range includes 0 it fails upon evaluation.

void BM_Example(benchmark::State& state)
{
  while (state.KeepRunning())
  {
    int i = state.range(0);
  }
  state.SetComplexityN(state.range(0));
}

BENCHMARK(BM_JumpTable)->RangeMultiplier(2)->Range(0, 1)->Complexity(benchmark::o1);

Result

F:\cruft\benchmark\src\complexity.cc:270: benchmark::ComputeBigO: Check (run.complexity_n) > (0)' Failed. Did you forget to call SetComplexityN?

Guide contributeur