We use this macro to mark blocks of code that should be explicitly optimized for size. They are used when implementing the reflection of each class, because even if you are optimizing for speed, the reflection is only executed once and it doesn't make sense to optimize that for speed.
This is a poor approach to PGO (Profile-Guided Optimization). For companies with access to source code like yours, we recommend directly injecting our cpps in your project (we are working to improve this step by having just a few unity files containing all our API) and compiling with PGO enabled to get the best balance between size and speed.
Just inspecting
CompilerSettings.h you can see the definitions for Visual Studio:
#define NS_BEGIN_COLD_REGION __pragma(optimize("s", on))
#define NS_END_COLD_REGION __pragma(optimize("", on))
#define NS_COLD_FUNC
And for GCC / Clang:
#define NS_BEGIN_COLD_REGION
#define NS_END_COLD_REGION
#define NS_COLD_FUNC __attribute__((cold, minsize))