|
|
@ -21,7 +21,6 @@ void bench_scoped_pad(benchmark::State &state, size_t wrapped_size, spdlog::deta
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void bench_formatter(benchmark::State &state, std::string pattern)
|
|
|
|
void bench_formatter(benchmark::State &state, std::string pattern)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto formatter = spdlog::details::make_unique<spdlog::pattern_formatter>(pattern);
|
|
|
|
auto formatter = spdlog::details::make_unique<spdlog::pattern_formatter>(pattern);
|
|
|
@ -29,7 +28,6 @@ void bench_formatter(benchmark::State &state, std::string pattern)
|
|
|
|
std::string logger_name = "logger-name";
|
|
|
|
std::string logger_name = "logger-name";
|
|
|
|
const char *text = "Hello. This is some message with length of 80 ";
|
|
|
|
const char *text = "Hello. This is some message with length of 80 ";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spdlog::details::log_msg msg(&logger_name, spdlog::level::info, text);
|
|
|
|
spdlog::details::log_msg msg(&logger_name, spdlog::level::info, text);
|
|
|
|
// formatter->format(msg, dest);
|
|
|
|
// formatter->format(msg, dest);
|
|
|
|
// printf("%s\n", fmt::to_string(dest).c_str());
|
|
|
|
// printf("%s\n", fmt::to_string(dest).c_str());
|
|
|
@ -60,7 +58,6 @@ void bench_formatters()
|
|
|
|
benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
|
|
|
|
benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// complex patterns
|
|
|
|
// complex patterns
|
|
|
|
std::vector<std::string> patterns = {
|
|
|
|
std::vector<std::string> patterns = {
|
|
|
|
"[%D %X] [%l] [%n] %v",
|
|
|
|
"[%D %X] [%l] [%n] %v",
|
|
|
@ -73,7 +70,6 @@ void bench_formatters()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
@ -89,4 +85,3 @@ int main(int argc, char *argv[])
|
|
|
|
benchmark::Initialize(&argc, argv);
|
|
|
|
benchmark::Initialize(&argc, argv);
|
|
|
|
benchmark::RunSpecifiedBenchmarks();
|
|
|
|
benchmark::RunSpecifiedBenchmarks();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|