[issue43511] tkinter with Tk 8.6.11 is slow on macOS
Thomas Wamm added the comment: I have forked my TerraLunar graphics program to make a simpler more portable version, called "TerraLunar-tkbench.py" to facilitate testing of the tkinter stack for graphics performance. The project folder is at: https://github.com/ThomasWamm/TerraLunar-tkbench.git The folder includes results and commentary from running the program on numerous platforms (MacOS, Windows10, Raspberry OS Linux) and Python versions. Here are the most interesting summary results: Apple M1 Mac Mini MacOS 11.2.3 (arm64 Apple Silicon, or Rosetta2 x86_64) Python 3.8.2Tcl/Tk 8.5.9 TerraLunar-tkbench 0.1.8 runtime = 37 (arm64) Python 3.8.7Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 69 (x86_64) Python 3.9.2Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 69 (x86_64) * Python 3.10.0a6 Tcl/Tk 8.6.11 TerraLunar-tkbench 0.1.8 runtime = 421 (arm64) * * Why is Tcl/Tk 8.6.11 on arm64 so slow? old iMac24-2007 MacOS 10.11.6 on 2.4 GHz Intel Core 2 Duo (x86_64) Python 3.7.3 Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 381 Python 3.8.2 Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 377 Python 3.9.2 Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 379 * Python 3.10.0a6 Tcl/Tk 8.6.11 TerraLunar-tkbench 0.1.8 runtime = 292 * * this is faster than the M1 Mac, differing in silicon and MacOS version. Dell laptop Windows10 i5-8250U >= 1.6 GHz quad-core x86_64 Python 3.9.2Tcl/Tk 8.6.9 TerraLunar-tkbench 0.1.8 runtime = 7 Python 3.10.0a6 Tcl/Tk 8.6.10 TerraLunar-tkbench 0.1.8 runtime = 7 # Windows10 seems to be the best environment for tkinter.py / Tcl / Tk graphics apps. -- Every Mac platform is sadly much slower than a comparable Windows platform, for tkinter graphics. But the new M1 Mac platform is the slowest by far, slower than even a much older Intel Mac running the same versions of Python 3.10.0a6 and Tk 8.6.11 That's enough involvement for this noobie; I've now learned how complicated this performance issue is. It's not on my critical path, so I'm going back to my regular project far removed from tkinter graphics. Good Luck folks! ...thomas -- ___ Python tracker <https://bugs.python.org/issue43511> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43511] tkinter with Tk 8.6.11 is slow on macOS
Thomas Wamm added the comment: tkinter performance on Windows 10 looks okay, no obvious problems. Attached is a transcript showing bench.py results for Pythons 3.8.2, 3.9.2, and 3.10.0a6 on Windows 10 on a Dell laptop with an Intel i5-8250U CPU (medium good speed, a good comparison to Apple M1 Mac). I originally raised this Issue because my new M1 Mac Mini performed so poorly compared to my Windows laptop, only for tkinter-related code. -- Added file: https://bugs.python.org/file49913/results_tk-bench_Win10_i5-8250U.txt ___ Python tracker <https://bugs.python.org/issue43511> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43511] tkinter with Tk 8.6.11 is slow on macOS
Thomas Wamm added the comment: I ran the bench.py and bench.tcl programs from E. Paine (epaine) on my M1 Mac Mini. Attached is a commented Terminal transcript. The tl;dr summary again is that Python 3.10.0a6 arm64 for Apple silicon is 3 to 100 times SLOWER than earlier pythons compiled for Intel x86-64 running with Rosetta2, when doing window operations thru Tcl/Tk. I have not yet attempted to install any version of Tcl/Tk independent of any Python or Apple build. I'm still learning slowly. And I am inspired to re-jig my little TerraLunar graphics program to run with python2.7 arm64. -- Added file: https://bugs.python.org/file49908/results-tkbench.txt ___ Python tracker <https://bugs.python.org/issue43511> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43511] tkinter with Tk 8.6.11 is slow on macOS
Thomas Wamm added the comment: Failed tkinter tests were already noted in Issue 42507. No mention of failures correlating with much slower testing. -- ___ Python tracker <https://bugs.python.org/issue43511> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43511] tkinter with Tk 8.6.11 is slow on macOS
Thomas Wamm added the comment: Summary: "poor tkinter performance correlates with failed self-tests" I'm an amateur hobbyist noobie programmer, so sophisticated testing is a challenge for me. I raised this issue because I noticed Python graphics thru tkinter is especially slow on MacOS, and especially ultra-slow on my new M1 Mac Mini with Python 3.9.2 or 3.10.0a6 for Apple silicon. Aside from this weird issue, the M1 Mac outperforms all my other computers (including Win10 on i5-9500T, and Raspberry Pi 400). I'm expecting at least 10x performance improvement on M1 Macs when this issue gets resolved. Anyway, I looked under the hood. I found some tkinter test programs runnable on MacOS with: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/test/runtktests.py The same program is buried in the Windows Python modules library, but was not findable in Python 3.7.3 for Linux on Raspberry Pi. So I ran runtktests.py on Windows 10 and MacOS in many configurations. All was good EXCEPT Python 3.9.2 and 3.10.0a6 on old MacOS 10.11.6 and new MacOS 11.2.3. Those configs report about 10 Failed tests in a suite of over 1000 tests, and interestingly the 3.9 and 3.10 tests run about 4x slower than the older Python 3.8 tests that reported zero failures. So poor tkinter performance on MacOS correlates with failed tkinter self-tests. Maybe a more expert person could dig deeper? -- ___ Python tracker <https://bugs.python.org/issue43511> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43511] tkinter with Tk 8.6.11 is slow on macOS
Thomas Wamm added the comment: I spent a few hours running numerous configurations (M1 Mac Mini, iMac24-2007, Win10 on i5-8250U, Raspberry Pi 4B, various Pythons from 3.7.3 to 3.10.0a6). It can get confusing. The primary interesting result is that Python 3.9.2 and 3.10.0a6 arm64 versions on M1 Mac Mini are the absolute worst performers by factors of 2 to 15, when relying on tkinter/Tcl/Tk for windows or graphics. Any Python3 on Windows 10 on an Intel i5 was at least 8x faster than the M1 Mac. Intel Python 3.9.2 beats arm64 Python 3.9.2 or 3.10.0a6. The problem is somewhere in the tkinter/Tcl/Tk layers or their connection to MacOS and arm64. Python 3.7.3 on Raspberry OS (Linux) performs in the middle between slow MacOS and fast Windows. The fastest configuration I found on the M1 Mac was Python 3.8.2 (Intel code) in combination with deprecated Tcl/Tk 8.5.9; that config was about 8x faster than 3.9.2 arm64 with Tcl/Tk 8.6.11. The simplest qualitative performance test is just use >>> help('modules') (in IDLE vs. python in a Terminal window) though my TerraLunar.py graphics program can give quantitative results. The Turtle graphics demo programs in IDLE also perform slow on the M1 Mac. -- ___ Python tracker <https://bugs.python.org/issue43511> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43511] Tk 8.6.11 slow on M1 Mac Mini MacOS Python 3.9.2 native ARM version
Thomas Wamm added the comment: An easy demo of the performance problem is to compare the execution speed of the single command: >>> help('modules') in a python3 shell in a terminal window (it's real fast), vs. inside the IDLE3 shell (it's terribly slow). I understand that IDLE3 uses the tkinter.py/Tcl/Tk toolset for windowing. There's something slowing it down on the M1 Mac Mini (MacOS 11.2.3), making it run much slower than on a Wintel PC or Linux Raspberry Pi. I don't know if the problem occurs with any Python versions other than 3.9.2 on MacOS. -- ___ Python tracker <https://bugs.python.org/issue43511> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43511] Tk 8.6.11 slow on M1 Mac Mini MacOS Python 3.9.2 native ARM version
New submission from Thomas Wamm : Comparing performance of a Tkinter graphics program with Python 3.9.2 on an M1 Mac Mini, I find it to be slower than earlier versions, and much slower than the same program running on other computers such as a Raspberry Pi 3B (Python 3.7.3). Initial investigation suggests the slow down is because of Tk 8.6.11. The same program on Windows 10 on Intel i5-8250U is at least 10x faster, contrary to expectations. Has anyone noticed similar? The program is simple & portable, downloadable from: https://github.com/ThomasWamm/TerraLunar.git All it does is 2-D orbital mechanics simulation, to teach me Python. -- components: Tkinter messages: 388822 nosy: thomaswamm priority: normal severity: normal status: open title: Tk 8.6.11 slow on M1 Mac Mini MacOS Python 3.9.2 native ARM version type: performance versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue43511> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com