2015-07-13 15:49:44 +02:00
|
|
|
# g3log is a KjellKod Logger
|
|
|
|
# 2015 @author Kjell Hedström, hedstrom@kjellkod.cc
|
|
|
|
# ==================================================================
|
|
|
|
# 2015 by KjellKod.cc. This is PUBLIC DOMAIN to use at your own
|
|
|
|
# risk and comes with no warranties.
|
|
|
|
#
|
|
|
|
# This code is yours to share, use and modify with no strings attached
|
|
|
|
# and no restrictions or obligations.
|
|
|
|
# ===================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# . performance test (average + worst case) for KjellKod's g3log
|
2019-02-18 20:43:04 +01:00
|
|
|
# Do 'cmake -DADD_G3LOG_BENCH_PERFORMANCE=ON' to enable this
|
|
|
|
option (ADD_G3LOG_BENCH_PERFORMANCE "g3log performance test" OFF)
|
2014-10-03 08:56:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-13 15:49:44 +02:00
|
|
|
# create the g3log's performance tests
|
2014-10-03 08:56:13 +02:00
|
|
|
# =========================
|
2015-07-13 15:49:44 +02:00
|
|
|
IF (ADD_G3LOG_BENCH_PERFORMANCE)
|
2014-10-03 08:56:13 +02:00
|
|
|
set(DIR_PERFORMANCE ${g3log_SOURCE_DIR}/test_performance)
|
|
|
|
|
2017-05-17 22:31:19 +02:00
|
|
|
message( STATUS "-DADD_G3LOG_BENCH_PERFORMANCE=ON" )
|
2014-10-03 08:56:13 +02:00
|
|
|
include_directories (${DIR_PERFORMANCE})
|
|
|
|
|
|
|
|
# MEAN PERFORMANCE TEST
|
2014-10-03 09:53:21 +02:00
|
|
|
add_executable(g3log-performance-threaded_mean
|
2014-10-03 08:56:13 +02:00
|
|
|
${DIR_PERFORMANCE}/main_threaded_mean.cpp
|
|
|
|
${DIR_PERFORMANCE}/performance.h)
|
2014-10-03 09:53:21 +02:00
|
|
|
# Turn on G3LOG performance flag
|
|
|
|
set_target_properties(g3log-performance-threaded_mean PROPERTIES
|
2015-07-20 07:10:56 +02:00
|
|
|
COMPILE_DEFINITIONS "G3LOG_PERFORMANCE=1")
|
2014-10-03 09:53:21 +02:00
|
|
|
target_link_libraries(g3log-performance-threaded_mean
|
2014-10-03 08:56:13 +02:00
|
|
|
${G3LOG_LIBRARY} ${PLATFORM_LINK_LIBRIES})
|
|
|
|
|
|
|
|
# WORST CASE PERFORMANCE TEST
|
2014-10-03 09:53:21 +02:00
|
|
|
add_executable(g3log-performance-threaded_worst
|
2014-10-03 08:56:13 +02:00
|
|
|
${DIR_PERFORMANCE}/main_threaded_worst.cpp ${DIR_PERFORMANCE}/performance.h)
|
2014-10-03 09:53:21 +02:00
|
|
|
# Turn on G3LOG performance flag
|
|
|
|
set_target_properties(g3log-performance-threaded_worst PROPERTIES
|
2015-07-20 07:10:56 +02:00
|
|
|
COMPILE_DEFINITIONS "G3LOG_PERFORMANCE=1")
|
2014-10-03 09:53:21 +02:00
|
|
|
target_link_libraries(g3log-performance-threaded_worst
|
2014-10-03 08:56:13 +02:00
|
|
|
${G3LOG_LIBRARY} ${PLATFORM_LINK_LIBRIES})
|
|
|
|
|
|
|
|
ELSE()
|
2017-05-17 22:31:19 +02:00
|
|
|
message( STATUS "-DADD_G3LOG_BENCH_PERFORMANCE=OFF" )
|
2015-07-13 15:49:44 +02:00
|
|
|
ENDIF(ADD_G3LOG_BENCH_PERFORMANCE)
|
2014-10-03 08:56:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|