[pypy-dev] Slow int code

Antonio Cuni anto.cuni at gmail.com
Mon Mar 4 10:20:34 CET 2013


On 03/04/2013 09:42 AM, Roger Flores wrote:
> On March 3, 2013 2:20 AM, Carl Friedrich Bolz wrote:
>> >Are you*sure*  you are running on a 64 bit machine?
> Sure?  No.  I assumed it's 64bit pypy because it was generating x86_64 instructions.  How would you check for sure?
>
> uname reports x86_64 on the machine I built pypy on.
>
> $ pypy --version
> Python 2.7.3 (42c0d1650cf4, Feb 23 2013, 01:53:42)
> [PyPy 2.0.0-beta1 with GCC 4.6.3]
>
> That doesn't show the machine size.
>
> pypy --info is interesting but doesn't help either

just a wild guess: is it possible that you generated pyc files with a 32bit 
version of pypy and then imported it on a 64bit one?

For example, suppose you have this foo.py:

def foo():
     return 2147483648
print type(foo())

if you import it on 32bit, it prints 'long' and generates a pyc file. If you 
then import 'foo' on 64bit, it still prints 'long', but if you remove the pyc 
and import again, it prints 'int'.
(This happens because 2147483648 is stored as a long inside the marshalled pyc 
file).

ciao,
Anto


More information about the pypy-dev mailing list