Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Parsing large XML responses #16

Open
zemanel opened this issue Jul 27, 2012 · 5 comments
Open

Parsing large XML responses #16

zemanel opened this issue Jul 27, 2012 · 5 comments

Comments

@zemanel
Copy link
Contributor

zemanel commented Jul 27, 2012

I'm currently not able to parse large endpoint responses due to memory issues (one of the endpoints is a list with 22,746 value entries and no result pagination).

A solution is apparently (as far as i know at the moment) parsing the response using stream parser like SAX (http://developer.android.com/reference/javax/xml/parsers/SAXParser.html). Taking a look at the library, it would be either refactoring or creating a paralel implementation of the ResponseParser and data type Serializer interfaces and implementations (since they are tied to org.w3c.dom.Element).

What do you think?

@timroes
Copy link
Collaborator

timroes commented Jul 27, 2012

I think SAX parser would to be preferred in general, since you are reading all the time from network. So I would replace the DOM parser through a SAX parser, if someone (hint hint) would write it :)
If you don't want to give it a look, I would give it a look within the next days. Just give me a hint, if you want to look at it, that we don't do the same work twice.

@zemanel
Copy link
Contributor Author

zemanel commented Jul 27, 2012

I've been reading documentation regarding using the SAX parser on Android [compatibility] but i'm unsure on how to refactor the library at the moment, if the current implementation should be replaced or a SAX based parsed added to it for example.

@timroes
Copy link
Collaborator

timroes commented Jul 27, 2012

I will change it so SAX parser tomorrow (German time). So if you have around 24 hours time from now, you will get a working SAX version. As it seem (https://github.com/zemanel/pypi-java-xmlrpc-client/tree/develop#implemented-xmlrpc-calls) you still have some other methods, you can implement first :-)

@zemanel
Copy link
Contributor Author

zemanel commented Jul 27, 2012

No rush and i would be glad to help :-) yes actually i was going over that; currently implementing the "search" method call of:

http://wiki.python.org/moin/PyPiXmlRpc

p.s.: the library you mentioned is a component of another project, https://github.com/zemanel/pypi-android , which will i hope will be a good app for tracking Python package releases, someday :-)

@timroes
Copy link
Collaborator

timroes commented Jul 28, 2012

For documentation reasons: I profiled your project, and as it seems most of the objects allocations will be there, even with SAX parser. But I will keep that in mind for later, and might give it a try some time, but not now, as I see no large chance, it will help the problem.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants