pypy

Equivalent to python's -R option that affects the hash of ints

南笙酒味 提交于 2019-12-03 23:54:48
问题 We have a large collection of python code that takes some input and produces some output. We would like to guarantee that, given the identical input, we produce identical output regardless of python version or local environment. (e.g. whether the code is run on Windows, Mac, or Linux, in 32-bit or 64-bit) We have been enforcing this in an automated test suite by running our program both with and without the -R option to python and comparing the output, assuming that would shake out any spots

Running Scrapy on PyPy

淺唱寂寞╮ 提交于 2019-12-03 20:39:54
Is it possible to run Scrapy on PyPy ? I've looked through the documentation and the github project, but the only place where PyPy is mentioned is that there were some unit tests being executed on PyPy 2 years ago, see PyPy support . There is also Scrapy fails in PyPy long discussion happened 3 years ago without a concrete resolution or a follow-up. From what I understand, the main Scrapy's dependency Twisted is known to work on PyPy . Scrapy also uses lxml for HTML parsing, which has a PyPy -friendly fork . The other dependency, pyOpenSSL is fully supported (thanks to @Glyph's comment). Yes.

easy_install with pypy while Python is installed

社会主义新天地 提交于 2019-12-03 12:45:51
I installed PyPy while still having Python 2.7 on my system. How do I install and then use easy_install with PyPy? What is the syntax for distinguishing where I want to install to with easy_install ? Should I set any environment variables for ease of use? I'm on Windows, but these questions seem relevant for all platform... Julien Chappuis You need to install easy_install for pypy manually. It's explained in the answer to this question : Installing Python eggs under PyPy An alternative solution is to install pip. Following the instructions in pip's documentation : wget https://bootstrap.pypa

PyPy significantly slower than CPython

一世执手 提交于 2019-12-03 12:08:18
I've been testing a cacheing system of my making. Its purpose is to speed up a Django web application. It stores everything in-memory. According to cProfile most of the time in my tests is spent inside QuerySet._clone() which turns out to be terribly inefficient (it's actually not that strange given the implementation). I was having high hopes for using PyPy to speed things up. I've got a 64-bit machine. However after installing all the required libraries it turns out that PyPy compiled code runs about 2.5x slower than regular Python code, and I don't know what to make out of it. The code is

Why is cffi so much quicker than numpy?

萝らか妹 提交于 2019-12-03 11:53:40
问题 I have been playing around with writing cffi modules in python, and their speed is making me wonder if I'm using standard python correctly. It's making me want to switch to C completely! Truthfully there are some great python libraries I could never reimplement myself in C so this is more hypothetical than anything really. This example shows the sum function in python being used with a numpy array, and how slow it is in comparison with a c function. Is there a quicker pythonic way of

pypy memory usage grows forever?

雨燕双飞 提交于 2019-12-03 11:42:59
问题 I have a complicated python server app, that runs constantly all the time. Below is a very simplified version of it. When I run the below app using python; "python Main.py". It uses 8mb of ram straight away, and stays at 8mb of ram, as it should. When I run it using pypy "pypy Main.py". It begins by using 22mb of ram and over time the ram usage grows. After a 30 seconds its at 50mb, after an hour its at 60mb. If I change the "b.something()" to be "pass" it doesn't gobble up memory like that.

Optimizing a reed-solomon encoder (polynomial division)

坚强是说给别人听的谎言 提交于 2019-12-03 10:46:34
I am trying to optimize a Reed-Solomon encoder, which is in fact simply a polynomial division operation over Galois Fields 2^8 (which simply means that values wrap-around over 255). The code is in fact very very similar to what can be found here for Go: http://research.swtch.com/field The algorithm for polynomial division used here is a synthetic division (also called Horner's method). I tried everything: numpy, pypy, cython. The best performance I get is by using pypy with this simple nested loop: def rsenc(msg_in, nsym, gen): '''Reed-Solomon encoding using polynomial division, better

How to install PyPy in anaconda

你说的曾经没有我的故事 提交于 2019-12-03 09:55:05
I have a Linux-64 bit machine. How do I install PyPy in my anaconda environment. I tried conda install pypy. It says there are no available packages. pip install pypy also returns a similar message. Is it that the only way to install PyPy is by downloading the tar.gz file from the website? Once installed, how do I configure my Anaconda environment in such a way so as to be able to switch from PyPy to other Python implementations when required? You can install PyPy3 from conda-forge : conda install -c conda-forge pypy3.6 And then use it like your regular python executable (notice that this is a

multiprocessing Listeners and Clients between python and pypy

陌路散爱 提交于 2019-12-03 08:58:47
Is it possible to have a Listener server process and a Client process where one of them uses a python interpreter and the other a pypy interpreter? Would conn.send() and conn.recv() interoperate well? I tried it out to see: import sys from multiprocessing.connection import Listener, Client address = ('localhost', 6000) def client(): conn = Client(address, authkey='secret password') print conn.recv_bytes() conn.close() def server(): listener = Listener(address, authkey='secret password') conn = listener.accept() print 'connection accepted from', listener.last_accepted conn.send_bytes('hello')

How to use PIL with PyPy?

烈酒焚心 提交于 2019-12-03 06:50:25
I searched a little bit but I couldn't find a tuto to use PIL with PyPy. According to PyPy's blog, PIL is supported. I installed PIL with pip in my PYTHONPATH. After the download, pip make 2 .pyd files: _imaging.pyd and _imagingmath.pyd. After the install, I copied %PYTHONPATH%/lib/site-packages/PIL to my PyPy site-packages directory. When I run my script (which uses PIL), it says it can't import the _imaging C module. How should I do it ? edit: I run this on Windows 7 x64 (python 2.7.1 32bits) here is the traceback (pypy 1.4.1 windows binary): Traceback (most recent call last): File "app_main