3

I am observing around 20% performance difference with python compiled with clang (Clang 3.4.1 ) when compared to python compiled with gcc (GCC 4.6).

I am using configuration script that comes with python. I am not sure if i am missing something on the optimisation of the clang complier. Please comment.

2
  • This is an interesting observation ... It's not really a question though. Is there something specific that you are trying to find out from this? If you want to know if there are better compiler flags, you'll need to give us more information (what compiler flags are you using?) Commented Nov 22, 2016 at 5:27
  • Trying to figure out clang compiler flags which can optimise the python performance. Commented Nov 22, 2016 at 6:12

1 Answer 1

1

Pure guesswork on my side but one huge difference of Clang vs. GCC is that Clang by default allows inlining of interposable functions in shared libraries (see e.g. this post for more details). This violates ELF interposition rules but usually allows to perform more aggressive optimizations.

GCC is more strict in this regard by default but you can ask for the same behavior with -fno-semantic-interposition (starting with GCC 5.3).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.