Kaydet (Commit) b8b3c8e2 authored tarafından Fredrik Lundh's avatar Fredrik Lundh

needforspeed: added Py_LOCAL macro, based on the LOCAL macro used

for SRE and others.  applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine.  ymmv.
üst a172c32c
...@@ -137,6 +137,23 @@ typedef Py_intptr_t Py_ssize_t; ...@@ -137,6 +137,23 @@ typedef Py_intptr_t Py_ssize_t;
# endif # endif
#endif #endif
/* PY_LOCAL can be used instead of static to get the fastest possible calling
* convention for functions that are local to a given module. It also enables
* inlining, where suitable. */
#undef USE_INLINE /* XXX - set via configure? */
#if defined(_MSC_VER)
/* ignore warnings if the compiler decides not to inline a function */
#pragma warning(disable: 4710)
/* fastest possible local call under MSVC */
#define Py_LOCAL(type) static __inline type __fastcall
#elif defined(USE_INLINE)
#define Py_LOCAL(type) static inline type
#else
#define Py_LOCAL(type) static type
#endif
#include <stdlib.h> #include <stdlib.h>
#include <math.h> /* Moved here from the math section, before extern "C" */ #include <math.h> /* Moved here from the math section, before extern "C" */
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment