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
350ff13d
Commit
350ff13d
authored
May 04, 2016
by
Kevin M. Godby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added g3log and glog benchmarks.
parent
254a6744
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
9 deletions
+73
-9
.gitmodules
.gitmodules
+3
-0
bench/CMakeLists.txt
bench/CMakeLists.txt
+2
-8
bench/g3log-async.cpp
bench/g3log-async.cpp
+63
-0
vendor/CMakeLists.txt
vendor/CMakeLists.txt
+4
-1
vendor/g3log
vendor/g3log
+1
-0
No files found.
.gitmodules
View file @
350ff13d
...
@@ -7,3 +7,6 @@
...
@@ -7,3 +7,6 @@
[submodule "vendor/easyloggingpp"]
[submodule "vendor/easyloggingpp"]
path = vendor/easyloggingpp
path = vendor/easyloggingpp
url = https://github.com/easylogging/easyloggingpp.git
url = https://github.com/easylogging/easyloggingpp.git
[submodule "vendor/g3log"]
path = vendor/g3log
url = https://github.com/KjellKod/g3log.git
bench/CMakeLists.txt
View file @
350ff13d
...
@@ -55,19 +55,13 @@ if(Boost_FOUND)
...
@@ -55,19 +55,13 @@ if(Boost_FOUND)
add_benchmark
(
boost-bench-mt LIBS
${
Boost_LIBRARIES
}
INCLUDES
${
Boost_INCLUDE_DIRS
}
DEFINITIONS
${
BOOST_DEFS
}
)
add_benchmark
(
boost-bench-mt LIBS
${
Boost_LIBRARIES
}
INCLUDES
${
Boost_INCLUDE_DIRS
}
DEFINITIONS
${
BOOST_DEFS
}
)
endif
()
endif
()
find_package
(
glog QUIET
)
if
(
TARGET glog
)
if
(
TARGET glog
)
add_benchmark
(
glog-bench LIBS glog
)
add_benchmark
(
glog-bench LIBS glog
)
add_benchmark
(
glog-bench-mt LIBS glog
)
add_benchmark
(
glog-bench-mt LIBS glog
)
endif
()
endif
()
# TODO make g2log find script
if
(
TARGET g3logger
)
# TODO use g2log git submodule
add_benchmark
(
g3log-async LIBS g3logger INCLUDES
"
${
g3log_SOURCE_DIR
}
/src"
)
find_package
(
g2log QUIET
)
if
(
g2log-FOUND
)
set
(
G2LOG_LIBRARIES lib_g2logger
)
set
(
G2LOG_INCLUDE_DIRS /home/gabi/devel/g2log/g2log/src
)
add_benchmark
(
g2log-async LIBS
${
G2LOG_LIBRARIES
}
INCLUDES
${
G2LOG_INCLUDE_DIRS
}
)
endif
()
endif
()
if
(
TARGET easylogging
)
if
(
TARGET easylogging
)
...
...
bench/g3log-async.cpp
0 → 100644
View file @
350ff13d
//
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#include <thread>
#include <vector>
#include <atomic>
#include <iostream>
#include <chrono>
#include <g3log/logworker.hpp>
#include <g3log/g3log.hpp>
using
namespace
std
;
template
<
typename
T
>
std
::
string
format
(
const
T
&
value
);
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
;
auto
g3log
=
g3
::
LogWorker
::
createLogWorker
();
auto
defaultHandler
=
g3log
->
addDefaultLogger
(
argv
[
0
],
"logs"
);
g3
::
initializeLogging
(
g3log
.
get
());
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
)
<<
"g3log 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
;
cout
<<
"Total: "
<<
howmany
<<
std
::
endl
;
cout
<<
"Threads: "
<<
thread_count
<<
std
::
endl
;
std
::
cout
<<
"Delta = "
<<
deltaf
<<
" seconds"
<<
std
::
endl
;
std
::
cout
<<
"Rate = "
<<
rate
<<
"/sec"
<<
std
::
endl
;
}
vendor/CMakeLists.txt
View file @
350ff13d
...
@@ -7,12 +7,15 @@
...
@@ -7,12 +7,15 @@
add_subdirectory
(
zf_log
)
add_subdirectory
(
zf_log
)
#
add_subdirectory(glog)
add_subdirectory
(
glog
)
add_library
(
easylogging INTERFACE
)
add_library
(
easylogging INTERFACE
)
set
(
SPDLOG_VENDORED_EASYLOGGING_ROOT
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/easyloggingpp"
CACHE INTERNAL
""
FORCE
)
set
(
SPDLOG_VENDORED_EASYLOGGING_ROOT
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/easyloggingpp"
CACHE INTERNAL
""
FORCE
)
target_include_directories
(
easylogging INTERFACE
"
${
SPDLOG_VENDORED_EASYLOGGING_ROOT
}
/src"
)
target_include_directories
(
easylogging INTERFACE
"
${
SPDLOG_VENDORED_EASYLOGGING_ROOT
}
/src"
)
add_subdirectory
(
g3log
)
#add_library(zflog INTERFACE)
#add_library(zflog INTERFACE)
#set(SPDLOG_VENDORED_ZFLOG_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/zf_log" CACHE INTERNAL "" FORCE)
#set(SPDLOG_VENDORED_ZFLOG_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/zf_log" CACHE INTERNAL "" FORCE)
#target_include_directories(zflog INTERFACE "${SPDLOG_VENDORED_ZFLOG_ROOT}/zf_log")
#target_include_directories(zflog INTERFACE "${SPDLOG_VENDORED_ZFLOG_ROOT}/zf_log")
...
...
g3log
@
6c1698c4
Subproject commit 6c1698c4f7db6b9e4246ead38051f9866ea3ac06
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