Skip to content

Commit fa53ba5

Browse files
committed
Adding measurements to comment for PYBIND11_NOINLINE_FORCED.
1 parent 3457185 commit fa53ba5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/pybind11/detail/common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@
102102
// For CUDA, GCC7, GCC8:
103103
// PYBIND11_NOINLINE_FORCED is incompatible with `-Wattributes -Werror`.
104104
// When defining PYBIND11_NOINLINE_FORCED, it is best to also use `-Wno-attributes`.
105+
// However, the measured shared-library size saving when using noinline are only
106+
// 1.7% for CUDA, -0.2% for GCC7, and 0.0% for GCC8 (using -DCMAKE_BUILD_TYPE=MinSizeRel,
107+
// the default under pybind11/tests).
105108
#if !defined(PYBIND11_NOINLINE_FORCED) && \
106109
(defined(__CUDACC__) || (defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8)))
107110
# define PYBIND11_NOINLINE_DISABLED

0 commit comments

Comments
 (0)