GNU/Linux vs. Windows as Python platform
tim.one at home.com
Fri May 18 09:56:06 CEST 2001
[Terry Reedy, wondering about Windows vs Linux]
> Someone emailed 'Is this a troll'? No. I currently have a Win98
> machine and wonder if there might be good enough reasons to add
> Linux to this or my next machine, perhaps within the next year.
Here's a game I enjoy playing on my Win98SE box:
1. Boot it.
2. Run pystone (Lib/test/pystone.py).
3. Jot down its outcome.
4. Immediately run pystone again.
5. Go to step 3.
What invariably happens for me on Win98SE is that pystone gets 50%(!) better
performance the *first* time it's run after a reboot; second and subsequent
runs never get anywhere near the first result. This wasn't true on my old
Win95 box, and isn't true on my Win2K box. Timings on Win98SE are, in my
repeated experience, extremely erratic and often counter-intuitive.
OTOH, run test_bufio.py from Python's standard test suite. On Win9x and
Linux boxes in the 800Mhz range, it takes about 2 seconds to complete. On my
comparable Win2K box, about 20(!) seconds.
I have no explanation for any of this, and since I can't look at the Windows
source code probably never will.
Ah, there *is* a way to boost pystone performance again under Win98SE without
rebooting: get into Python and create a giant array, then get out of Python
and run pystone again. For example, my home desktop box has 256Mb RAM, and
something like this is plenty:
>>> a = [None] * 50000000
That forces Python to allocate and crawl over a 200Mb chunk of memory. For
whatever reason, that's enough to convince Win98SE to forget whatever it is
it's caching that's *killing* pystone performance.
Windows life is just full of pleasures like this <wink>.
> By binaries, I was thinking of extension modules like PIL, wxPython, etc
> for which the developers have often made Windows binaries but not
> everything else.
Distutils is in the process of solving that one. You should get a Linux box
too just to help that along ...
> Summary of what read so far. Answer depends on priority. For heavy-duty
> standalone Python programs, running under Linux might well give more room
> and more speed. For application automation, Windows/COM still easily
> beats Linux.
Well, that, plus for applications period. I don't count developer tools as
applications in this sense: if you ever want to something *other* than
program with your box, Windows is simply loads more fun. Heh: just last
week I was watching some streaming video on my Windows box at work, and Guido
looked over my shoulder and exclaimed "computers can do that now?!".
usb-ports-to-work-ly y'rs - tim
More information about the Python-list