Coding style article with interesting section on white space

Alex Martelli aleaxit at yahoo.com
Sun Jan 30 11:23:37 EST 2005


<beliavsky at aol.com> wrote:

> I had in mind the Polyhedron Fortran 90 benchmarks for Windows and
> Linux on Intel x86 at
> http://www.polyhedron.co.uk/compare/linux/f90bench_p4.html and
> http://www.polyhedron.co.uk/compare/win32/f90bench_p4.html . The speed
> differences of Absoft, Intel, and Lahey between Linux and Windows for
> individual programs, not to mention the average differential across all
> programs, is much less than 25%. The differences on a single OS between
> compilers can be much larger, but that has less bearing on portability
> across OS's.

So, you think that comparing a single commercial compiler for code
generation on Windows vs Linux (which _should_ pretty obviously be
pretty much identical) is the same thing as comparing the code
generation of two DIFFERENT compilers, a commercial one on Windows vs a
free one on Linux?!  This stance sounds singularly weird to me.

If on one platform you use a compiler that's only available for that
platform (such as Microsoft's), then "portability across OS's" (in terms
of performance, at least) can of course easily be affected.  If you care
so much, splurge for (say) the commercial compilers that Intel will be
quite happy to sell you for both platforms -- the one for Windows is a
plug-in replacement for Microsoft's, inside MS Visual Studio (at least,
it used to be that way, with VS 6.0; I don't know if that's still the
case), the one for Linux is usable in lieu of the free gcc.  So, each
should compile Python without any problem.  Presumably, the optimizer
and code generator will be essentially unchanged across platforms, as
they are in the offerings of other vendors of commercial compilers -- it
would seem silly for any vendor to do otherwise!

If one has no funding to purchase commercial compilers for several
platforms, or one doesn't care particularly about the differences in
speed resulting from different compilers' optimizers, then, surprise
surprise, one's programs are quite liable to have different performance
on different platforms.  Trying to imply that this has ANYTHING to do
with the LANGUAGE the programs are coded in, as opposed to the compilers
and expenses one is willing to incur for them, is either an extremely
serious error of logic, if incurred in good faith, or else is an attempt
to "score points" in a discussion, and then good faith is absent.


Alex



More information about the Python-list mailing list