Hello,

Being a programmer myself I realise that a report on performance degradation 
should ideally contain a small test program that clearly reproduces the 
problem. However, unfortunately, I do not have the time at present to isolate 
the issue to a small test case. But the good news (or bad news, I suppose) is 
that the problem appears to be reasonably general, namely it happens with two 
completely different programs.

Anyway, what I am claiming is that Python 3.10 is between 1.5 and 2.5 times 
SLOWER than Python 3.8, for rather generic scientific calculations such as 
Fourier analysis, ODE solving and plotting. On the one hand, the "test case" is 
a rather complex program that calculates Wigner function of a quantum system 
and the result is 9 seconds when run with 3.8 and 23 seconds when run with 3.10 
(very easy to reproduce: just clone this repository: 
https://github.com/tigran123/quantum-infodynamics and run "time 
bin/harmonic-oscillator-solve.sh" from the dynamics subdirectory and then edit 
initgauss.py and solve.py to point to python3.10 and run it again). Make sure 
your TMPDIR points somewhere fast. My machine is a very fast 6-core i7-6800K at 
4.2GHz and 128GB RAM. The storage is also a very fast NVMe, about 3GB/s.

After this try a completely different program which simulates a mathematical 
pendulum using PyQT (GUI) and it gives FPS:14-15 when run with 3.8 and only 
11-12 when run with 3.10. Again, it is easy to reproduce if you have cloned the 
above repository: just go to classical-mechanics/pendulum subdirectory and run 
psim.py (click on the Play button in the control window and observe FPS in the 
plot window). Then edit psim.py to point to Python 3.10 and run it again. You 
would need PyQt5, matplotlib, numpy, scipy, pyFFTW for these programs to work.

I realise that you would much prefer a small specific test case, but I still 
hope that this report is "better than nothing". I do really desire to help 
improve Python and will provide more information if requested. I use Python 
everywhere, even in Termux on Android, and am quite saddened by this 
degradation...

With Python 3.8 I used these package versions:

matplotlib          3.1.3       
numpy               1.18.1      
pyFFTW            0.12.0      
PyQt5                5.13.2      
scipy                  1.4.1       

With Python 3.10 I used these package versions:

matplotlib          3.5.0
numpy              1.21.4
pyFFTW           0.12.0
PyQt5               5.15.6
scipy                1.7.3

Both Python 3.8 and 3.10 were compiled and installed by myself with 
"./configure --enable-optimizations ; make ; sudo make install".

Kind regards,
Tigran
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/34FP7FEG36UVBFW3ZDTL7GOQRSRBSXTQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to