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
0f66c63f
Commit
0f66c63f
authored
Mar 21, 2018
by
Alexander Kiselev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update easyloggingpp, Add plog
parent
fd1c4d78
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
190 additions
and
6 deletions
+190
-6
Makefile
bench/Makefile
+16
-4
easyl-async.conf
bench/easyl-async.conf
+10
-0
easyl-mt.conf
bench/easyl-mt.conf
+1
-1
easyl.conf
bench/easyl.conf
+1
-1
easylogging-bench-async.cpp
bench/easylogging-bench-async.cpp
+67
-0
plog-bench-mt.cpp
bench/plog-bench-mt.cpp
+61
-0
plog-bench.cpp
bench/plog-bench.cpp
+34
-0
No files found.
bench/Makefile
View file @
0f66c63f
...
...
@@ -11,7 +11,8 @@ binaries=spdlog-bench spdlog-bench-mt spdlog-async spdlog-null-async \
p7-bench p7-bench-mt
\
log4cpp-bench log4cpp-bench-mt
\
log4cplus-bench log4cplus-bench-mt
\
easylogging-bench easylogging-bench-mt
easylogging-bench easylogging-bench-mt easylogging-bench-async
\
plog-bench plog-bench-mt
all
:
$(binaries)
...
...
@@ -22,7 +23,7 @@ spdlog-bench-mt: spdlog-bench-mt.cpp
$(CXX)
spdlog-bench-mt.cpp
-o
spdlog-bench-mt
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
spdlog-async
:
spdlog-async.cpp
$(CXX)
spdlog-async.cpp
-o
spdlog-async
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
$(CXX)
spdlog-async.cpp
-o
spdlog-async
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
-g
spdlog-null-async
:
spdlog-null-async.cpp
$(CXX)
spdlog-null-async.cpp
-o
spdlog-null-async
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
...
...
@@ -74,9 +75,20 @@ log4cplus-bench-mt: log4cplus-bench-mt.cpp
EASYL_FLAGS
=
-I
$(HOME)
/easyloggingpp/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)
$(CXX)
easylogging-bench-mt.cpp
-o
easylogging-bench-mt
$(CXXFLAGS)
$(EASYL_FLAGS)
$(CXX_RELEASE_FLAGS)
easylogging-bench-async
:
easylogging-bench-async.cpp
$(CXX)
easylogging-bench-async.cpp
-o
easylogging-bench-async
$(CXXFLAGS)
$(EASYL_FLAGS)
$(CXX_RELEASE_FLAGS)
PLOG_FLAGS
=
-I
$(HOME)
/include
plog-bench
:
plog-bench.cpp
$(CXX)
plog-bench.cpp
-o
plog-bench
$(CXXFLAGS)
$(PLOG_FLAGS)
$(CXX_RELEASE_FLAGS)
plog-bench-mt
:
plog-bench-mt.cpp
$(CXX)
plog-bench-mt.cpp
-o
plog-bench-mt
$(CXXFLAGS)
$(PLOG_FLAGS)
$(CXX_RELEASE_FLAGS)
.PHONY
:
clean
clean
:
...
...
bench/easyl-async.conf
0 → 100644
View file @
0f66c63f
*
GLOBAL
:
FORMAT
=
"[%datetime]: %levshort %thread %msg"
FILENAME
= ./
logs
/
easylogging
-
async
.
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/easyl-mt.conf
View file @
0f66c63f
*
GLOBAL
:
FORMAT
=
"[%datetime]: %msg"
FORMAT
=
"[%datetime]: %
levshort %thread %
msg"
FILENAME
= ./
logs
/
easylogging
-
mt
.
log
ENABLED
=
true
TO_FILE
=
true
...
...
bench/easyl.conf
View file @
0f66c63f
*
GLOBAL
:
FORMAT
=
"[%datetime]: %msg"
FORMAT
=
"[%datetime]: %
levshort %
msg"
FILENAME
= ./
logs
/
easylogging
.
log
ENABLED
=
true
TO_FILE
=
true
...
...
bench/easylogging-bench-async.cpp
0 → 100644
View file @
0f66c63f
//
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#include <atomic>
#include <chrono>
#include <iostream>
#include <thread>
#include <vector>
#define ELPP_THREAD_SAFE
#define ELPP_EXPERIMENTAL_ASYNC
#include "easylogging++.h"
#include "easylogging++.cc"
INITIALIZE_EASYLOGGINGPP
using
namespace
std
;
int
main
(
int
argc
,
char
*
argv
[])
{
using
namespace
std
::
chrono
;
using
clock
=
steady_clock
;
int
thread_count
=
10
;
if
(
argc
>
1
)
thread_count
=
atoi
(
argv
[
1
]);
int
howmany
=
1000000
;
// Load configuration from file
el
::
Configurations
conf
(
"easyl-async.conf"
);
el
::
Loggers
::
reconfigureLogger
(
"default"
,
conf
);
std
::
atomic
<
int
>
msg_counter
{
0
};
vector
<
thread
>
threads
;
auto
start
=
clock
::
now
();
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
();
}
duration
<
float
>
delta
=
clock
::
now
()
-
start
;
float
deltaf
=
delta
.
count
();
auto
rate
=
howmany
/
deltaf
;
std
::
cout
<<
"Total: "
<<
howmany
<<
std
::
endl
;
std
::
cout
<<
"Threads: "
<<
thread_count
<<
std
::
endl
;
std
::
cout
<<
"Delta = "
<<
deltaf
<<
" seconds"
<<
std
::
endl
;
std
::
cout
<<
"Rate = "
<<
rate
<<
"/sec"
<<
std
::
endl
;
return
0
;
}
bench/plog-bench-mt.cpp
0 → 100644
View file @
0f66c63f
//
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#include <atomic>
#include <chrono>
#include <iostream>
#include <thread>
#include <vector>
#include "plog/Log.h"
using
namespace
std
;
int
main
(
int
argc
,
char
*
argv
[])
{
using
namespace
std
::
chrono
;
using
clock
=
steady_clock
;
int
thread_count
=
10
;
if
(
argc
>
1
)
thread_count
=
atoi
(
argv
[
1
]);
int
howmany
=
1000000
;
plog
::
init
(
plog
::
debug
,
"logs/plog-bench-mt.log"
);
std
::
atomic
<
int
>
msg_counter
{
0
};
vector
<
thread
>
threads
;
auto
start
=
clock
::
now
();
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
<<
"plog message #"
<<
counter
<<
": This is some text for your pleasure"
;
}
}));
}
for
(
auto
&
t
:
threads
)
{
t
.
join
();
}
duration
<
float
>
delta
=
clock
::
now
()
-
start
;
float
deltaf
=
delta
.
count
();
auto
rate
=
howmany
/
deltaf
;
std
::
cout
<<
"Total: "
<<
howmany
<<
std
::
endl
;
std
::
cout
<<
"Threads: "
<<
thread_count
<<
std
::
endl
;
std
::
cout
<<
"Delta = "
<<
deltaf
<<
" seconds"
<<
std
::
endl
;
std
::
cout
<<
"Rate = "
<<
rate
<<
"/sec"
<<
std
::
endl
;
return
0
;
}
bench/plog-bench.cpp
0 → 100644
View file @
0f66c63f
//
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#include <chrono>
#include <iostream>
#include <memory>
#include "plog/Log.h"
int
main
(
int
,
char
*
[])
{
using
namespace
std
::
chrono
;
using
clock
=
steady_clock
;
int
howmany
=
1000000
;
plog
::
init
(
plog
::
debug
,
"logs/plog-bench.log"
);
auto
start
=
clock
::
now
();
for
(
int
i
=
0
;
i
<
howmany
;
++
i
)
LOG_INFO
<<
"plog message #"
<<
i
<<
": This is some text for your pleasure"
;
duration
<
float
>
delta
=
clock
::
now
()
-
start
;
float
deltaf
=
delta
.
count
();
auto
rate
=
howmany
/
deltaf
;
std
::
cout
<<
"Total: "
<<
howmany
<<
std
::
endl
;
std
::
cout
<<
"Delta = "
<<
deltaf
<<
" seconds"
<<
std
::
endl
;
std
::
cout
<<
"Rate = "
<<
rate
<<
"/sec"
<<
std
::
endl
;
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