Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
971c1f46
Commit
971c1f46
authored
Nov 12, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated latency tests
parent
34c60e54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
Makefile
bench/Makefile
+6
-6
latency.cpp
bench/latency.cpp
+16
-4
No files found.
bench/Makefile
View file @
971c1f46
CXX
?=
g++
CXXFLAGS
=
-march
=
native
-Wall
-Wextra
-pedantic
-Wconversion
-std
=
c++11
-pthread
-I
../include
-fmax-errors
=
1
CXXFLAGS
=
-march
=
native
-Wall
-Wextra
-pedantic
-Wconversion
-std
=
c++11
-pthread
-I
../include
-fmax-errors
=
1
CXX_RELEASE_FLAGS
=
-O3
-flto
-Wl
,--no-as-needed
binaries
=
padder_bench
binaries
=
bench.cpp async_bench latency
padder_bench
all
:
$(binaries)
bench
:
bench.cpp
$(CXX)
bench.cpp
-o
bench
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
async_bench
:
async_bench.cpp
$(CXX)
async_bench.cpp
-o
async_bench
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
latency
:
latency.cpp
$(CXX)
latency.cpp
-o
latency
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
-lbenchmark
padder_bench
:
padder_bench.cpp
$(CXX)
padder_bench.cpp
-o
padder_bench
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
-lbenchmark
.PHONY
:
clean
...
...
bench/latency.cpp
View file @
971c1f46
...
...
@@ -59,6 +59,18 @@ void bench_logger(benchmark::State &state, std::shared_ptr<spdlog::logger> logge
}
}
void
bench_disabled_macro
(
benchmark
::
State
&
state
,
std
::
shared_ptr
<
spdlog
::
logger
>
logger
)
{
int
i
=
0
;
benchmark
::
DoNotOptimize
(
i
);
//prevent unused warnings
benchmark
::
DoNotOptimize
(
logger
);
//prevent unused warnings
for
(
auto
_
:
state
)
{
SPDLOG_LOGGER_DEBUG
(
logger
,
"Hello logger: msg number {}..............."
,
i
++
);
SPDLOG_DEBUG
(
"Hello logger: msg number {}..............."
,
i
++
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -74,14 +86,14 @@ int main(int argc, char *argv[])
prepare_logdir
();
//
Single threaded benchmark
s
//
disabled logger
s
auto
disabled_logger
=
std
::
make_shared
<
spdlog
::
logger
>
(
"bench"
,
std
::
make_shared
<
null_sink_mt
>
());
disabled_logger
->
set_level
(
spdlog
::
level
::
off
);
benchmark
::
RegisterBenchmark
(
"disabled-level"
,
bench_logger
,
disabled_logger
)
->
UseRealTime
();
benchmark
::
RegisterBenchmark
(
"disabled-at-compile-time"
,
bench_disabled_macro
,
disabled_logger
);
benchmark
::
RegisterBenchmark
(
"disabled-at-runtime"
,
bench_logger
,
disabled_logger
);
auto
null_logger_st
=
std
::
make_shared
<
spdlog
::
logger
>
(
"bench"
,
std
::
make_shared
<
null_sink_st
>
());
benchmark
::
RegisterBenchmark
(
"null_sink_st (500_bytes c_str)"
,
bench_c_string
,
std
::
move
(
null_logger_st
))
->
UseRealTime
();
benchmark
::
RegisterBenchmark
(
"null_sink_st (500_bytes c_str)"
,
bench_c_string
,
std
::
move
(
null_logger_st
));
benchmark
::
RegisterBenchmark
(
"null_sink_st"
,
bench_logger
,
null_logger_st
);
// basic_st
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment