[pypy-dev] which xml libraries? was (Re: PyPy 1.4 released)

Stefan Behnel stefan_ml at behnel.de
Mon Nov 29 14:58:01 CET 2010


René Dudfield, 29.11.2010 14:52:
> On Mon, Nov 29, 2010 at 1:40 PM, Stefan Behnel wrote:
>> Amaury Forgeot d'Arc, 28.11.2010 11:44:
>>> 2010/11/28 Maciej Fijalkowski
>>>
>>>> On Sun, Nov 28, 2010 at 11:58 AM, René Dudfield wrote:
>>>>> what xml libraries are people using with pypy?  What is working well?
>>>>
>>>> PyExpat works, although it's slow (ctypes-based implementation). I
>>>> know genshi has some troubles with it, someone is debugging now.
>>>> Besides I don't think there are any working (unless someone wrote a
>>>> pure-python one)
>>>
>>> PyExpat is now a built-in module, implemented in RPython,
>>> and should have reasonable performance.
>>
>> Hmm, reasonable?
>>
>> $ ./bin/pypy -m timeit -s 'import xml.etree.ElementTree as ET' \
>>       'ET.parse("ot.xml")'
>> 10 loops, best of 3: 1.27 sec per loop
>>
>> $ python2.7 -m timeit -s 'import xml.etree.ElementTree as ET' \
>>       'ET.parse("ot.xml")'
>> 10 loops, best of 3: 486 msec per loop
>>
>> $ python2.7 -m timeit -s 'import xml.etree.cElementTree as ET' \
>>       'ET.parse("ot.xml")'
>> 10 loops, best of 3: 33.7 msec per loop
>
> Ah, does etree work in pypy?  That's just python right?

Yes, ET is plain Python. cET is not, though, as the name indicates.

Stefan




More information about the Pypy-dev mailing list