diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2006-05-26 11:54:04 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2006-05-26 11:54:04 (GMT) |
commit | 57640f5c575ce284b041595c238f8ac615f1618d (patch) | |
tree | 8ce11c0c24239fe6482f7468b6af2fd035e43474 /Include | |
parent | 567a8ffd09eab6d741aa91ed3a0f92502114f4a6 (diff) | |
download | cpython-57640f5c575ce284b041595c238f8ac615f1618d.zip cpython-57640f5c575ce284b041595c238f8ac615f1618d.tar.gz cpython-57640f5c575ce284b041595c238f8ac615f1618d.tar.bz2 |
needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pyport.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/pyport.h b/Include/pyport.h index 9d46470..07fdf28 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -141,6 +141,10 @@ typedef Py_intptr_t Py_ssize_t; * convention for functions that are local to a given module. It also enables * inlining, where suitable. * + * If PY_LOCAL_AGGRESSIVE is defined before python.h is included, a more + * "aggressive" inlining is enabled. This may lead to code bloat, and may + * slow things down for those reasons. Use with care. + * * NOTE: You can only use this for functions that are entirely local to a * module; functions that are exported via method tables, callbacks, etc, * should keep using static. @@ -149,6 +153,10 @@ typedef Py_intptr_t Py_ssize_t; #undef USE_INLINE /* XXX - set via configure? */ #if defined(_MSC_VER) +#if defined(PY_LOCAL_AGGRESSIVE) +/* enable more aggressive optimization for visual studio */ +#pragma optimize("agtw", on) +#endif /* ignore warnings if the compiler decides not to inline a function */ #pragma warning(disable: 4710) /* fastest possible local call under MSVC */ |