diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 83fa468..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/CMakeLists.txt b/CMakeLists.txt index ac78173..49dfe08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,8 @@ cmake_minimum_required(VERSION 3.2) project(g3log CXX) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/test_performance/Performance.cmake b/test_performance/Performance.cmake index 83bfd62..53cd4f2 100644 --- a/test_performance/Performance.cmake +++ b/test_performance/Performance.cmake @@ -22,10 +22,32 @@ # ========================= IF (ADD_G3LOG_BENCH_PERFORMANCE) set(DIR_PERFORMANCE ${g3log_SOURCE_DIR}/test_performance) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") message( STATUS "-DADD_G3LOG_BENCH_PERFORMANCE=ON" ) include_directories (${DIR_PERFORMANCE}) + find_library(TCMALLOC_LIBRARY NAMES tcmalloc) + if(NOT TCMALLOC_LIBRARY) + message(FATAL_ERROR "tcmalloc library not found") + else() + message( STATUS "tcmalloc: ${TCMALLOC_LIBRARY} was found" ) + endif() + + find_library(PROFILER NAMES profiler) + if(NOT PROFILER) + message(FATAL_ERROR "PROFILER library not found") + else() + message( STATUS "PROFILER: ${PROFILER} was found" ) + endif() + + + # add_executable(your_executable ${YOUR_SOURCES}) + # target_link_libraries(your_executable PRIVATE ${TCMALLOC_LIBRARY}) + + + # MEAN PERFORMANCE TEST add_executable(g3log-performance-threaded_mean ${DIR_PERFORMANCE}/main_threaded_mean.cpp @@ -34,7 +56,7 @@ set_target_properties(g3log-performance-threaded_mean PROPERTIES COMPILE_DEFINITIONS "G3LOG_PERFORMANCE=1") target_link_libraries(g3log-performance-threaded_mean - ${G3LOG_LIBRARY} ${PLATFORM_LINK_LIBRIES}) + ${G3LOG_LIBRARY} ${PLATFORM_LINK_LIBRIES} ${PROFILER} ) # WORST CASE PERFORMANCE TEST add_executable(g3log-performance-threaded_worst @@ -43,7 +65,7 @@ set_target_properties(g3log-performance-threaded_worst PROPERTIES COMPILE_DEFINITIONS "G3LOG_PERFORMANCE=1") target_link_libraries(g3log-performance-threaded_worst - ${G3LOG_LIBRARY} ${PLATFORM_LINK_LIBRIES}) + ${G3LOG_LIBRARY} ${PLATFORM_LINK_LIBRIES} ${PROFILER}) ELSE() message( STATUS "-DADD_G3LOG_BENCH_PERFORMANCE=OFF" ) diff --git a/test_unit/Test.cmake b/test_unit/Test.cmake index d272af0..1c9eb16 100644 --- a/test_unit/Test.cmake +++ b/test_unit/Test.cmake @@ -18,6 +18,7 @@ # Unit test for g3log (cmake -DUSE_G3LOG_UNIT_TEST=ON ..) option (ADD_G3LOG_UNIT_TEST "g3log unit tests" ON) + message( STATUS "-DADD_G3LOG_UNIT_TEST=OFF" ) # 4. create the unit tests for g3log --- ONLY TESTED THE UNIT TEST ON LINUX @@ -52,7 +53,7 @@ enable_testing() set(DIR_UNIT_TEST ${g3log_SOURCE_DIR}/test_unit) - message( STATUS "-DADD_G3LOG_UNIT_TEST=ON" ) + # obs see this: http://stackoverflow.com/questions/9589192/how-do-i-change-the-number-of-template-arguments-supported-by-msvcs-stdtupl # and this: http://stackoverflow.com/questions/2257464/google-test-and-visual-studio-2010-rc