[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2019-04-11 Thread Inada Naoki
Inada Naoki added the comment: https://github.com/Homebrew/homebrew-core/blob/b2aff6271caa04508fb1529fdd5edbb22f4e7f21/Formula/python%402.rb#L75-L82 Homebrew checks compiler version too. I don't think it's worth enough to add more code to avoid this trouble. -- resolution: -> wont

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2019-04-11 Thread Inada Naoki
Inada Naoki added the comment: I'm using Mojave. I don't have regression. $ /usr/local/bin/python2 x.py # Homebrew python@2 1.681729 $ /usr/bin/python x.py # System python2 1.891549 Could someone using High Sierra or Sierra test it? x.py is test script in

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-04-29 Thread Michael Romero
Michael Romero added the comment: So is this now considered resolved for High Sierra users via 2.7.15rc1? -- nosy: +Michael Romero ___ Python tracker

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-04-14 Thread Ned Deily
Ned Deily added the comment: A followup - Ronald asked: > w.r.t. detection of the clang/llvm version on Apple's system compiler: Is it > worthwhile to do so? Now that Xcode 9.3 (for macOS 10.13+) is officially released, I ran a quick series of test on it and on the most

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-11 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: This should remain everyone that backporting performance improvements is not a no-brainer. -- nosy: +pitrou ___ Python tracker

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-09 Thread Ronald Oussoren
Ronald Oussoren added the comment: I different question w.r.t. detection of the clang/llvm version on Apple's system compiler: Is it worthwhile to do so? If the compiler included in the Xcode 9.3 beta (and hence likely the one in Xcode 9.3 final) fixes the

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread INADA Naoki
INADA Naoki added the comment: I don't know exactly. But as far as I saw, Python 3's eval loop has less function-wide local variables. For example, ROT_THREE uses only block local variable.

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread Ned Deily
Ned Deily added the comment: Can anyone explain what the difference is between 2.7 and 3.6, i.e. why there is the performance regression for 2.7 but not for 3.6 using the same compiler instance? It would be better to understand and solve that problem rather than trying to

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread INADA Naoki
INADA Naoki added the comment: How can we distinguish Apple LLVM with LLVM easily? Or should we disable computed-gotos by default on LLVM? It's only for Python 2. 5x slowdown is too large comparing to 10% speedup. -- ___

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread Zhiming Wang
Zhiming Wang added the comment: Yeah, Apple LLVM versions are a major headache. I resorted to feature detection, using C++ coroutines support as the clang 5 distinguisher[1]: $ cat /tmp/test/stub.cc #include int main() { return 0; } $

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread INADA Naoki
INADA Naoki added the comment: I'm sorry, my patch doesn't work on Xcode (Apple LLVM). computed-gotos is still enabled by default. Apple doesn't expose LLVM version. It's really annoying. $ cat x.c #include int main() { printf("__clang__ : %d\n", __clang__);

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-07 Thread INADA Naoki
Change by INADA Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-07 Thread INADA Naoki
INADA Naoki added the comment: New changeset 2942b909d9a428e6683d90b3436cfa4a81bd5d8a by INADA Naoki in branch '2.7': bpo-32616: Disable computed gotos by default for clang < 5 (GH-5574) https://github.com/python/cpython/commit/2942b909d9a428e6683d90b3436cfa4a81bd5d8a

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-06 Thread INADA Naoki
Change by INADA Naoki : -- keywords: +patch pull_requests: +5392 stage: -> patch review ___ Python tracker ___

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-06 Thread Ned Deily
Ned Deily added the comment: Quick test: there doesn't seem to be a similar regression when building 3.6 with the current clang provided by Xcode 9.2, just with 2.7. And both 2.7 and 3.6 configure HAVE_COMPUTED_GOTOS on. Benjamin? (FWIW, the 2.7.x binaries provided by the

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-06 Thread Zhiming Wang
Zhiming Wang added the comment: Turns out python 2.7.10 doesn't suffer from the performance issue even when compiled with stock clang 4.x, and upon further investigation, I tracked down the commit that introduced the regression: commit

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-06 Thread INADA Naoki
INADA Naoki added the comment: Bad news: --enable-optimization doesn't solve it. I hope same thing doesn't happen for Python 3. Anyone tried Xcode 9.3? What version of LLVM does Apple use? Anyway, I think we need help of LLVM expert. --

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-05 Thread INADA Naoki
INADA Naoki added the comment: This is assembly code for FAST_DISPATCH() https://paste.ubuntu.com/26523948/ It seems there are many redundant spills. But I don't know how to remove them. Are their clang expert? -- ___

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-05 Thread INADA Naoki
INADA Naoki added the comment: It seems clang4 failed to efficient register assigning. FYI, --without-computed-gotos configure option make penalty smaller. clang 5 (wihtout CGs): 2.653426 clang 5 (with CGs): 1.997584 clang 4 (without CGs): 3.330879 clang 4 (with CGs):

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-04 Thread Ronald Oussoren
Ronald Oussoren added the comment: Is there anything we (the CPython developers) can do about this? If I read the issue correctly clang 5.x generates faster binaries than clang 3.x and 4.x. If that is indeed the issue there's probably not much we can do about this.

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-26 Thread Terry J. Reedy
Change by Terry J. Reedy : -- components: +macOS nosy: +ned.deily, ronaldoussoren ___ Python tracker ___

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-22 Thread Tim Smith
Change by Tim Smith : -- nosy: +tdsmith ___ Python tracker ___ ___ Python-bugs-list

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-22 Thread Zhiming Wang
Zhiming Wang added the comment: My benchmarks above do contain py37 (master) stats. -- ___ Python tracker ___

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-22 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Has anyone done the same analysis with Python 3.6 or 3.7? -- nosy: +barry ___ Python tracker ___

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-22 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- components: +Interpreter Core type: -> performance ___ Python tracker ___

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-21 Thread INADA Naoki
Change by INADA Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-21 Thread Zhiming Wang
New submission from Zhiming Wang : Python 2.7 could be significantly slower (5x in some cases) when compiled with clang 3.x or 4.x, compared to clang 5.x. This is quite a problem on macOS, since the latest clang from Apple (which comes with Xcode 9.2) is based on LLVM 4.x.