473,396 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

xml.sax.xmlreader and expat

Hi,

We're using xml.sax.xmlreader in our app (http://www.goombah.com, which
is written in Python).

In Python 2.3.x, does that use the C-language expat under the hood? The
reason I'm asking is because we're wondering if we can speed up the
parsing significantly.

Thanks in advance for any input anyone can give.

Gary
--

Gary Robinson
VP/Innovation
Emergent Music, LLC
gr*******@goombah.com
207-942-3463
Company: http://www.goombah.com
Blog: http://www.garyrobinson.net

Jun 27 '06 #1
2 1733
Gary Robinson wrote:
We're using xml.sax.xmlreader in our app (http://www.goombah.com, which
is written in Python).

In Python 2.3.x, does that use the C-language expat under the hood?
yes.
The reason I'm asking is because we're wondering if we can speed up the
parsing significantly.


if you want speed, you don't really want any of the xml.sax or xml.dom
stuff. I'm a bit biased, but I'd recommend the iterparse interface to
cElementTree:

http://effbot.org/zone/celementtree.htm
http://effbot.org/zone/element-iterparse.htm

</F>

Jun 28 '06 #2
Fredrik Lundh wrote:
Gary Robinson wrote:
We're using xml.sax.xmlreader in our app (http://www.goombah.com,
which is written in Python).

In Python 2.3.x, does that use the C-language expat under the hood?


yes.
The reason I'm asking is because we're wondering if we can speed up
the parsing significantly.


if you want speed, you don't really want any of the xml.sax or xml.dom
stuff. I'm a bit biased, but I'd recommend the iterparse interface to
cElementTree


or to lxml (if you want to do more than just parsing):

http://cheeseshop.python.org/pypi/lxml/1.1alpha

Why?

http://effbot.org/zone/celementtree.htm#benchmarks
http://codespeak.net/lxml/performanc...nd-serialising

Stefan
Jun 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike Brown | last post by:
Python 2.3 comes with its own version of Expat. setup.py says it is Expat 1.95.2, but the code in Modules/expat seems to actually be Expat 1.95.6. It's really 1.95.6, right? -- Mike
1
by: Doug | last post by:
I am running solaris 7 on two machines. I compiled python 2.2.1 with expat parser on one machine. The python binary is located in /usr/local/bin and the libraries are located in /usr/local/lib. ...
1
by: Ingo Blank | last post by:
Hi, while 95% of my 'psycoed' applications run fine, it throws SIGSEGVs in conjunction with expat. Anybody noticed the same ? Python 2.3.2 (#4, Nov 13 2003, 02:10:49) on linux2 $ uname...
2
by: Thomas Guettler | last post by:
Hi! What are the difference between xml.parsers.expat and xml.sax? Up to now I used xml.sax.make_parser and subclass from ContentHandler. I think xml.sax.make_parser uses expat as default....
4
by: alainpoint | last post by:
Hello, I use Elementtree to parse an elementary SVG file (in fact, it is one of the examples in the "SVG essentials" book). More precisely, it is the fig0201.svg file in the second chapter. The...
1
by: David Madore | last post by:
Hi! Anyone in for a Byzantine discussion on XML well-formedness? Here's the situation: test.xml contains --- test.xml: cut after --- <?xml version="1.0" encoding="us-ascii"?> <!DOCTYPE...
1
by: Angus Lepper | last post by:
I'm writing a stock ticker for a stock market simulation, and can load the data into the xmlreader in the first place, but can't figure out how to refresh/update the data in it. Any ideas? Code:...
2
by: dwelch91 | last post by:
Hi, c.l.p.'ers- I am having a problem with the import of xml.parsers.expat that has gotten me completely stumped. I have two programs, one a PyQt program and one a command line (text) program...
1
by: vadlapatlahari | last post by:
Hi, I get the following error with Expat while configuring my application server. Can anyone suggest a solution? When i do an ldd, i get the following : $ldd Expat.so Expat.so needs:...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.