why is python slow on Solaris?

Gerhard Häring gerhard.nospam at bigfoot.de
Sun Aug 5 15:22:13 EDT 2001


On Sun, 05 Aug 2001 19:56:07 +0100, Tony McDonald wrote:
>On 5/8/01 5:46 pm, "Skip Montanaro" <skip at pobox.com> wrote:
>
>> 
>>   Tony> This is on an Enterprise 3500 - UltraSparc at 400MHz (ie a big box)
>>   ...
>>   Tony> Can anyone tell me why this is so, and more importantly, what I
>>   Tony> can do to compile up python to run faster on Solaris?
>> 
>> Well, you didn't really give any indication what optimization you used with
>> gcc.  I'd start there.  There are a number of SPARC-specific flags for gcc
>> as well as a number of different optimization levels you can try.
>
>Thanks for the reply Skip, yes Sorry I did miss that part out;
>
>gcc -fPIC -g -O2 -Wall -Wstrict-prototypes
>
>I've built a copy of GCC 3.0 with a 64-bit architecture, but there are
>problems with that as the following shows;
>
>% file python
>python:         ELF 64-bit MSB executable SPARCV9 Version 1, dynamically
>linked, not stripped
>
>Python 2.1 (#6, Aug  5 2001, 16:34:01)
>[GCC 3.0] on sunos5
>Type "copyright", "credits" or "license" for more information.
>>>> import pystone
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "pystone.py", line 37, in ?
>    from time import clock
>ImportError: ld.so.1: ../../python: fatal: libgcc_s.so.1: open failed: No
>such file or directory

Hmm. Seems like it doesn't find the runtime library. Setting LD_LIBRARY_PATH
(or whatever the equivalent on Solaris is) or linking with -rpath should help.

You could also try compiling with Sun's compiler, if you have access to it. One
might think they know how to generate optimized code for their own chip.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://highqualdev.com              public key at homepage
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y: x+y, [chr(ord(x)^42) for x in list('zS^BED\nX_FOY\x0b')])



More information about the Python-list mailing list