最近、仕事でPyPy3を試したりしているので、メモを書き残しておく。 PyPy - Welcome to PyPy インストール 今回はUbuntu 14.04LTSで試した。PyPy3はPPAリポジトリに無いので、Linux向けのコンパイル済みバイナリをダウンロードして使うことにした。 利用するときは、virtualenvでpypy3用の環境を作っている。 $ wget https://bitbucket.org/pypy/pypy/downloads/pypy3-2.4.0-linux64.tar.bz2 $ bzip2 -dc pypy3-2.4.0-linux64.tar.bz2|tar xf - $ sudo mv pypy3-2.4.0-linux64 /opt/ $ sudo ln -s /opt/pypy3-2.4.0-linux64/bin/pypy3 /usr/bin/
リストに要素を追加する処理速度の比較 前提 処理速度の比較として、Pythonの公式実装であるCPythonと、PythonのPythonによるJITコンパイラ実装であるPyPyの実行時間について比較しました。 Pythonのリスト内包表記で使った以下の3つの関数に対して、Pythonで実行時間を計測する方法 その1で定義したデコレータを用いました。 評価対象の関数 # 1. testfunc1: 空リストを用意してappend @time def testfunc1(rangelist): templist = [] for temp in rangelist: templist.append(temp) # 2. testfunc2: 1+appendをオブジェクト化 @time def testfunc2(rangelist): templist = [] append = temp
The second branch was done by Gregor Wegberg for his master thesis and finished by Maciej Fijałkowski and Armin Rigo. Because of the way it works, the PyPy GC from time to time moves the objects in memory, meaning that their address can change. Therefore, if you want to pass pointers to some external C function (for example, write(2) or read(2)), you need to ensure that the objects they are pointi
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く