[pypy-issue] [issue1690] Use of cffi slowing down PyPy(?)

slacky tracker at bugs.pypy.org
Tue Feb 11 04:47:28 CET 2014

New submission from slacky <jarlholta at gmail.com>:

A little testing tells me that the cffi FFI module is actually slowing down the
whole interpreter/PyPy. My test is done by importing a module that uses FFI:
"from _tkinter import tklib", this file seems to only define some C headers. Tho
the same thing happens if I import _tkinter, of FixTk (both indirectly using tklib).

All my test file does is iterating from 0 to a large number (1000000000).

Test output::Importing tklib (slow.py)
>> mean: 2.790600 sec
>> min:  2.781000 sec
>> max:  2.812000 sec
>> sum:  13.953000 sec

Test output::Without importing tklib (fast.py)
>> mean: 0.893600 sec
>> min:  0.875000 sec
>> max:  0.921000 sec
>> sum:  4.468000 sec

slow.py (http://pastebin.com/2CeLHuEQ) imports tklib from the _tkinter module.
fast.py (http://pastebin.com/FBAYd2sp) does not import it.

Note: I by no means USE tkinter or any stuff from the module imported, simply
importing it is enough to cause generally slower PyPy.

I can't say with certainty that the drop in speed is caused by cffi, but it does
seem like it's related to it.

messages: 6532
nosy: pypy-issue, slacky
priority: performance bug
status: unread
title: Use of cffi slowing down PyPy(?)

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list