Skip to content

Commit b624f3c

Browse files
committed
implement various performance optimizations
1 parent d2f8843 commit b624f3c

File tree

7 files changed

+173
-84
lines changed

7 files changed

+173
-84
lines changed

.github/workflows/sanitizers.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
env:
2626
ASAN_OPTIONS: check_initialization_order=1:strict_init_order=1:detect_stack_use_after_return=1:detect_leaks=1:detect_invalid_pointer_pairs=2
2727
UBSAN_OPTIONS: print_stacktrace=1:print_summary=1
28-
28+
2929
defaults:
3030
run:
3131
working-directory: ${{ github.workspace }}/build
@@ -41,13 +41,15 @@ jobs:
4141
run: apt update && apt install --allow-downgrades -y git cmake ${{ matrix.compiler.pkgs }}
4242

4343
- name: setup-catch
44-
run: bash ./install_catch.sh -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
44+
env:
45+
CXX: ${{ matrix.compiler.cxx }}
46+
run: bash ../tools/install_catch.sh Release
4547

4648
- name: setup-build
47-
run: cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_FLAGS="-fsanitize=${{ matrix.sanitizer }} -g -fno-omit-frame-pointer"
49+
run: cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-fsanitize=${{ matrix.sanitizer }} -g -fno-omit-frame-pointer" -DSMP_BUILD_BENCHMARKS=OFF
4850

4951
- name: build
5052
run: cmake --build .
51-
53+
5254
- name: run-tests
53-
run: ctest --output-on-failure --schedule-random
55+
run: ctest --output-on-failure --schedule-random

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,4 @@
55
.vs/
66
*.hint
77

8-
# Build results
9-
out/
10-
build/*
11-
!build/*.sh
12-
*.exe
13-
148
.cache/

CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ project(small_unique_ptr VERSION 0.1 LANGUAGES CXX)
55
include(GNUInstallDirs)
66
include(CMakePackageConfigHelpers)
77

8+
option(SMP_BUILD_BENCHMARKS "Build the benchmarks for the library when ON." ON)
9+
810
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build")
911
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1012

@@ -47,6 +49,11 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/smp-config-version.cmake"
4749

4850
include(CTest)
4951

50-
enable_testing()
51-
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/test")
52-
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/benchmark")
52+
if(BUILD_TESTING)
53+
enable_testing()
54+
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/test")
55+
endif()
56+
57+
if (SMP_BUILD_BENCHMARKS)
58+
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/benchmark")
59+
endif()

build/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)