Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Disable computed gotos by default for clang < 5.0. It caused significant
performance regression.
12 changes: 10 additions & 2 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,19 @@ PyObject *
PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
{
#ifdef DYNAMIC_EXECUTION_PROFILE
#undef USE_COMPUTED_GOTOS
#undef USE_COMPUTED_GOTOS
#endif
#ifdef HAVE_COMPUTED_GOTOS
#ifndef USE_COMPUTED_GOTOS
#define USE_COMPUTED_GOTOS 1
#if defined(__clang__) && (__clang_major__ < 5)
/* Computed gotos caused significant performance regression
* with clang < 5.0.
* https://bugs.python.org/issue32616
*/
#define USE_COMPUTED_GOTOS 0
#else
#define USE_COMPUTED_GOTOS 1
#endif
#endif
#else
#if defined(USE_COMPUTED_GOTOS) && USE_COMPUTED_GOTOS
Expand Down