python-for-android icon indicating copy to clipboard operation
python-for-android copied to clipboard

p4a's python seems to be slower than termux'

Open obfusk opened this issue 4 years ago • 2 comments

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).

obfusk avatar Aug 16 '20 21:08 obfusk

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)

mnba avatar Sep 28 '20 06:09 mnba

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.

obfusk avatar Oct 01 '20 11:10 obfusk