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
b38a3645
Commit
b38a3645
authored
Dec 20, 2014
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
easylogging bench
parent
7674bdb4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
2 deletions
+90
-2
bench/Makefile
bench/Makefile
+13
-2
bench/easyl.conf
bench/easyl.conf
+10
-0
bench/easylogging-bench-mt.cpp
bench/easylogging-bench-mt.cpp
+47
-0
bench/easylogging-bench.cpp
bench/easylogging-bench.cpp
+16
-0
bench/run_all.sh
bench/run_all.sh
+4
-0
No files found.
bench/Makefile
View file @
b38a3645
...
@@ -3,7 +3,9 @@ CXXFLAGS = -march=native -Wall -Wshadow -Wextra -pedantic -std=c++11 -pthread -W
...
@@ -3,7 +3,9 @@ CXXFLAGS = -march=native -Wall -Wshadow -Wextra -pedantic -std=c++11 -pthread -W
CXX_RELEASE_FLAGS
=
-O3
-flto
CXX_RELEASE_FLAGS
=
-O3
-flto
all
:
spdlog-bench spdlog-bench-mt spdlog-bench-async spdlog-bench-mt-async boost-bench boost-bench-mt glog-bench glog-bench-mt g2log-bench g2log-bench-mt
binaries
=
spdlog-bench spdlog-bench-mt spdlog-bench-async spdlog-bench-mt-async boost-bench boost-bench-mt glog-bench glog-bench-mt g2log-bench g2log-bench-mt easylogging-bench easylogging-bench-mt
all
:
$(binaries)
spdlog-bench
:
spdlog-bench.cpp
spdlog-bench
:
spdlog-bench.cpp
$(CXX)
spdlog-bench.cpp
-o
spdlog-bench
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
$(CXX)
spdlog-bench.cpp
-o
spdlog-bench
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
...
@@ -43,8 +45,17 @@ g2log-bench-mt: g2log-bench-mt.cpp
...
@@ -43,8 +45,17 @@ g2log-bench-mt: g2log-bench-mt.cpp
EASYL_FLAGS
=
-I
../../easylogging/src/
easylogging-bench
:
easylogging-bench.cpp
$(CXX)
easylogging-bench.cpp
-o
easylogging-bench
$(CXXFLAGS)
$(EASYL_FLAGS)
$(CXX_RELEASE_FLAGS)
easylogging-bench-mt
:
easylogging-bench-mt.cpp
$(CXX)
easylogging-bench-mt.cpp
-o
easylogging-bench-mt
$(CXXFLAGS)
$(EASYL_FLAGS)
$(CXX_RELEASE_FLAGS)
.PHONY
:
clean
clean
:
clean
:
rm
-f
*
.o logs/
*
spdlog-bench spdlog-bench-mt spdlog-bench-async spdlog-bench-mt-async boost-bench boost-bench-mt glog-bench glog-bench-mt g2log-bench g2log-bench-mt
rm
-f
*
.o logs/
*
$(binaries)
rebuild
:
clean all
rebuild
:
clean all
...
...
bench/easyl.conf
0 → 100644
View file @
b38a3645
*
GLOBAL
:
FORMAT
=
"[%datetime]: %msg"
FILENAME
= ./
logs
/
easylogging
.
log
ENABLED
=
true
TO_FILE
=
true
TO_STANDARD_OUTPUT
=
false
MILLISECONDS_WIDTH
=
3
PERFORMANCE_TRACKING
=
false
MAX_LOG_FILE_SIZE
=
10485760
Log_Flush_Threshold
=
10485760
bench/easylogging-bench-mt.cpp
0 → 100644
View file @
b38a3645
#include <thread>
#include <vector>
#include <atomic>
#define _ELPP_THREAD_SAFE
#include "easylogging++.h"
_INITIALIZE_EASYLOGGINGPP
using
namespace
std
;
int
main
(
int
argc
,
char
*
argv
[])
{
int
thread_count
=
10
;
if
(
argc
>
1
)
thread_count
=
atoi
(
argv
[
1
]);
int
howmany
=
1000000
;
// Load configuration from file
el
::
Configurations
conf
(
"easyl.conf"
);
el
::
Loggers
::
reconfigureLogger
(
"default"
,
conf
);
std
::
atomic
<
int
>
msg_counter
{
0
};
vector
<
thread
>
threads
;
for
(
int
t
=
0
;
t
<
thread_count
;
++
t
)
{
threads
.
push_back
(
std
::
thread
([
&
]()
{
while
(
true
)
{
int
counter
=
++
msg_counter
;
if
(
counter
>
howmany
)
break
;
LOG
(
INFO
)
<<
"easylog message #"
<<
counter
<<
": This is some text for your pleasure"
;
}
}));
}
for
(
auto
&
t
:
threads
)
{
t
.
join
();
};
return
0
;
}
bench/easylogging-bench.cpp
0 → 100644
View file @
b38a3645
#include "easylogging++.h"
_INITIALIZE_EASYLOGGINGPP
int
main
(
int
,
char
*
[])
{
int
howmany
=
1000000
;
// Load configuration from file
el
::
Configurations
conf
(
"easyl.conf"
);
el
::
Loggers
::
reconfigureLogger
(
"default"
,
conf
);
for
(
int
i
=
0
;
i
<
howmany
;
++
i
)
LOG
(
INFO
)
<<
"easylog message #"
<<
i
<<
": This is some text for your pleasure"
;
return
0
;
}
bench/run_all.sh
View file @
b38a3645
#~/bin/bash
#~/bin/bash
exec
2>&1
echo
"Running benchmakrs (all with 1000,000 writes to the logs folder)"
echo
"Running benchmakrs (all with 1000,000 writes to the logs folder)"
echo
echo
echo
"boost-bench (single thread).."
echo
"boost-bench (single thread).."
...
...
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