performance of python in arm cpu vs x86 cpu

1,467 views
Skip to first unread message

Degenerate Tech

unread,
Nov 5, 2021, 12:03:49 PM11/5/21
to Kivy users support
if we take two similar configuration of cpu and OS but one is arm and another x86 . will python program run in same speed in both cpu ? 

or arm python  become slower than x86 python .?


Robert

unread,
Nov 5, 2021, 1:18:47 PM11/5/21
to Kivy users support
Take a class on computer architecture! Narrowing the question to instruction set architecture misses the point.

Turn the question around, ask how do I write software that runs optimally (NOT 'in the same time') on an 'x86 like' architecture and on an 'arm like' architecture? The answer is if necessary use native threads.  Any real answer would also require thinking about the GPU.

With respect to Python, if the question is how do I write software that runs as fast as C code? Generally you can't. Abstraction has a price. Python has a C interface so you can prioritize performance over abstraction, as implemented in any number of Python packages.

If a program is slow, it is ALWAYS because the programmer created it to be slow (by some choice the programmer made). Once a programmer understands this, they are free to review their choices (which does not mean jump to conclusions).

Fundamental thing to remember:

Good, Fast, Cheap, pick any two.🤣

Elliot Garbus

unread,
Nov 5, 2021, 1:35:56 PM11/5/21
to kivy-...@googlegroups.com
In the abstract they both should run about the same speed.  The reality of performance usually depends on the specifics.  Do the 2 similarly configured systems have the same memory bandwidth? Same cache sizes…. If the 2 system perform equivalently for most C programs, I would expect similar performance. 

Most arm based devices are developed for mobile, I would expect they would have lower memory bandwidth and as a result lower performance than a device targeting a laptop or desktop. 

If you look at the M1 devices designed by Apple you see similar performance between x86 and arm. 

Sent from my iPhone

On Nov 5, 2021, at 9:05 AM, Degenerate Tech <sksah...@gmail.com> wrote:

if we take two similar configuration of cpu and OS but one is arm and another x86 . will python program run in same speed in both cpu ? 

or arm python  become slower than x86 python .?


--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/bc5b8f4b-1c6a-465d-b628-2a9b5c8b178fn%40googlegroups.com.

Robert

unread,
Nov 5, 2021, 4:53:30 PM11/5/21
to Kivy users support
As I understand it Apple (on one single core benchmark) reports an M1 70% performance increase over x86_64. The OP I think sees a decrease in single core performance on Arm compared x86_64.

The point is I think that they are not 'similarly configured'. Each hardware has different design criterion.

The number of cores used is also a factor, as an experiment I tried this on Android using Python. See the plot at the bottom of this page https://github.com/Android-for-Python/Multi-Service-Example . The overall shape is almost exactly what one might expect, 8 cores is a practical max due to memory bandwidth on most machines.

Degenerate Tech

unread,
Nov 6, 2021, 1:44:50 PM11/6/21
to Kivy users support
very nice explanation. i have some  issues with python kivy and kivymd apps which is not working very smooth in arm android 8.0 .may be problem of  my programming approach.
but that app working very well in desktop pc see in google play store "kivymd ui examples"
but one thing i want to share .if i use dart or java or javascript to develope mobile apps these apps more smooth and start faster than python kivy apps.

Robert

unread,
Nov 6, 2021, 3:54:56 PM11/6/21
to Kivy users support
Yep, there are always trade offs when we choose a language to write in.

In general write for, and test early on, the slowest device you want to support. At least you will avoid surprises.
Reply all
Reply to author
Forward
0 new messages