Lars Heuer, 14.01.2010 18:15:
> Has someone thought about porting the lxml *API* to Java / Jython?
>
> lxml seems to be popular and it would be nice to be able to run Python
> programs using lxml in Jython, maybe emulating only a subset of lxml
> using JDOM / DOM / XOM / Saxon / Xalan-J etc?
Speaking of XML in Jython in general, it looks like there is some potential
for optimising the existing standard library support:
$ jython -m timeit -s 'from xml.etree.ElementTree import parse'
'parse(".../ot.xml")'
10 loops, best of 3: 4.7 sec per loop
$ python3.1 -m timeit -s 'from xml.etree.ElementTree import parse'
'parse(".../ot.xml")'
10 loops, best of 3: 330 msec per loop
$ python3.1 -m timeit -s 'from xml.etree.cElementTree import parse'
'parse(".../ot.xml")'
10 loops, best of 3: 41.3 msec per loop
$ python3.1 -m timeit -s 'from lxml.etree import parse' 'parse(".../ot.xml")'
10 loops, best of 3: 37.9 msec per loop
(CPython 3.1.1; Jython 2.5.1; lxml trunk (2.3); Ubuntu 9.10; OpenJDK 1.6.0
64-bit server; ot.xml is a simple 3.4MB no-namespace XML file containing
the old christian testament)
Stefan
|