mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 08:25:43 +08:00
Merge pull request #1846 from MathiasMagnus/fix-bench
Avoid relying on function name decay mechanics
This commit is contained in:
commit
23dfb4e2f9
@ -34,14 +34,14 @@ void bench_formatters()
|
|||||||
for (auto &flag : all_flags)
|
for (auto &flag : all_flags)
|
||||||
{
|
{
|
||||||
auto pattern = std::string("%") + flag;
|
auto pattern = std::string("%") + flag;
|
||||||
benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
|
benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern);
|
||||||
|
|
||||||
// pattern = std::string("%16") + flag;
|
// pattern = std::string("%16") + flag;
|
||||||
// benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
|
// benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern);
|
||||||
//
|
//
|
||||||
// // bench center padding
|
// // bench center padding
|
||||||
// pattern = std::string("%=16") + flag;
|
// pattern = std::string("%=16") + flag;
|
||||||
// benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
|
// benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
// complex patterns
|
// complex patterns
|
||||||
@ -52,7 +52,7 @@ void bench_formatters()
|
|||||||
};
|
};
|
||||||
for (auto &pattern : patterns)
|
for (auto &pattern : patterns)
|
||||||
{
|
{
|
||||||
benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern)->Iterations(2500000);
|
benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern)->Iterations(2500000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
|
benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern);
|
||||||
}
|
}
|
||||||
benchmark::Initialize(&argc, argv);
|
benchmark::Initialize(&argc, argv);
|
||||||
benchmark::RunSpecifiedBenchmarks();
|
benchmark::RunSpecifiedBenchmarks();
|
||||||
|
Loading…
Reference in New Issue
Block a user