python-for-android
python-for-android copied to clipboard
p4a's python seems to be slower than termux'
I noticed that the response time (time curl localhost:5000/something | wc -l
) for my webview flask app is slower (in my case ~2.7s avg vs ~1.3s agv) than when I run the exact same code with termux' python (on the exact same android device).
What about Python versions, are they the same? Can this be the cause for a difference? I recall termux latest version was 3.8.0 while P4A always tends to use latest bleeding edge version. (And IMO this was not good decision from point of view of stability of releases)
Good question! But yes, I tested with identical Python versions (and in my experience Termux usually has the latest version fairly quickly).
I just tested again with Python 3.8.6 and got ~1.5s vs ~1s avg (the difference in speed between this test and the previous one is probably because of changes to my code, not because Python got faster).
I took a brief look at how Termux builds Python and did see some differences there, but nothing that would seem to explain this.