Merge pull request #21431 from danlark1/master

Add function alignment for better performance
This commit is contained in:
alexey-milovidov 2021-04-15 01:38:20 +03:00 committed by GitHub
commit 7a2ba9507d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -290,6 +290,12 @@ if (COMPILER_GCC OR COMPILER_CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsized-deallocation")
endif ()
# falign-functions=32 prevents from random performance regressions with the code change. Thus, providing more stable
# benchmarks.
if (COMPILER_GCC OR COMPILER_CLANG)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -falign-functions=32")
endif ()
# Compiler-specific coverage flags e.g. -fcoverage-mapping for gcc
option(WITH_COVERAGE "Profile the resulting binary/binaries" OFF)