Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Performance on Windows

Is Python generally slower on Windows vs. a *nix machine? Python seems to blaze on my Mac OS X machine whereas it seems to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory.

I particularly notice this in Mercurial but I figure this may simply be how Mercurial is packaged on windows.

like image 200
Frank V Avatar asked Dec 03 '09 20:12

Frank V


People also ask

Is Python slow on Windows?

In this article we'll discover that Python is not a bad language that is just very slow. It is optimized for the purpose it is built: easy syntax, readable code and a lot of freedom for the developer. These design choices, however, do make Python code slower than other languages like C and Java.

Is Python faster in Linux than Windows?

Python performance in windows lower than in Linux by almost 50%


2 Answers

I wanted to follow up on this and I found something that I believe is 'my answer'. It appears that Windows (vista, which is what I notice this on) is not as fast in handling files. This was mentioned by tony-p-lee.

I found this comparisons of Ubuntu vs Vista vs Win7. Their results are interesting and like they say, you need to take the results with a grain of salt. But I think the results lead me to the cause. Python, which I feel was indirectly tested, is about equivalent if not a tad-bit faster on Windows.. See the section "Richards benchmark".

Here is their graph for file transfers:

Graph - small file HD to HD
(source: tuxradar.com)

I think this specifically help address the question because Hg is really just a series of file reads, copies and overall handling. Its likely this is causing the delay.

http://www.tuxradar.com/content/benchmarked-ubuntu-vs-vista-vs-windows-7

like image 86
Frank V Avatar answered Sep 27 '22 23:09

Frank V


No real numbers here but it certainly feels like the start up time is slower on Windows platforms. I regularly switch between Ubuntu at home and Windows 7 at work and it's an order of magnitude faster starting up on Ubuntu, despite my work machine being at least 4x the speed.

As for runtime performance, it feels about the same for "quiet" applications. If there are any GUI operations using Tk on Windows, they are definitely slower. Any console applications on windows are slower, but this is most likely due to the Windows cmd rendering being slow more than python running slowly.

like image 24
Chris Smith Avatar answered Sep 28 '22 00:09

Chris Smith