Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
29d1790f
Commit
29d1790f
authored
Nov 04, 2014
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bench # threads can be passed at cmd line as first arg
parent
5d302532
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
bench-comparison/boost-bench-mt.cpp
bench-comparison/boost-bench-mt.cpp
+5
-1
bench-comparison/boost-bench.cpp
bench-comparison/boost-bench.cpp
+3
-2
bench-comparison/spdlog-bench-mt.cpp
bench-comparison/spdlog-bench-mt.cpp
+6
-2
bench-comparison/spdlog-bench.cpp
bench-comparison/spdlog-bench.cpp
+3
-2
No files found.
bench-comparison/boost-bench-mt.cpp
View file @
29d1790f
...
...
@@ -36,10 +36,14 @@ void init()
using
namespace
std
;
int
main
(
int
,
char
*
[])
int
main
(
int
argc
,
char
*
argv
[])
{
int
thread_count
=
10
;
if
(
argc
>
1
)
thread_count
=
atoi
(
argv
[
1
]);
int
howmany
=
1000000
;
init
();
logging
::
add_common_attributes
();
...
...
bench-comparison/boost-bench.cpp
View file @
29d1790f
...
...
@@ -30,14 +30,15 @@ void init()
}
int
main
(
int
,
char
*
[])
int
main
(
int
argc
,
char
*
argv
[])
{
int
howmany
=
1000000
;
init
();
logging
::
add_common_attributes
();
using
namespace
logging
::
trivial
;
src
::
severity_logger_mt
<
severity_level
>
lg
;
for
(
int
i
=
0
;
i
<
1000000
;
++
i
)
for
(
int
i
=
0
;
i
<
howmany
;
++
i
)
BOOST_LOG_SEV
(
lg
,
info
)
<<
"Boost logger message #"
<<
i
;
return
0
;
...
...
bench-comparison/spdlog-bench-mt.cpp
View file @
29d1790f
...
...
@@ -4,12 +4,16 @@
#include "spdlog/spdlog.h"
#include <iostream>
using
namespace
std
;
int
main
(
int
,
char
*
[])
int
main
(
int
argc
,
char
*
argv
[])
{
int
thread_count
=
10
;
if
(
argc
>
1
)
thread_count
=
atoi
(
argv
[
1
]);
int
howmany
=
1000000
;
namespace
spd
=
spdlog
;
...
...
bench-comparison/spdlog-bench.cpp
View file @
29d1790f
...
...
@@ -2,14 +2,15 @@
#include "spdlog/spdlog.h"
int
main
(
int
,
char
*
[])
int
main
(
int
argc
,
char
*
argv
[])
{
int
howmany
=
1000000
;
namespace
spd
=
spdlog
;
///Create a file rotating logger with 5mb size max and 3 rotated files
auto
logger
=
spd
::
rotating_logger_mt
(
"file_logger"
,
"logs/spd-sample"
,
10
*
1024
*
1024
,
5
);
logger
->
set_pattern
(
"[%Y-%b-%d %T.%e]: %v"
);
for
(
int
i
=
0
;
i
<
1000000
;
++
i
)
for
(
int
i
=
0
;
i
<
howmany
;
++
i
)
logger
->
info
()
<<
"spdlogger message #"
<<
i
;
return
0
;
...
...
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