Winston Gutkowski wrote:
Yohan Weerasinghe wrote:Thanks for the reply. what did you mean by a 'profiler'?
It's a program that can analyse your program while it's running, and give you some idea of what is being executed most.
An alternative to the above suggestion: Ask someone WHY you're trying to parse 500 megabytes of text on an ad hoc basis.
This (I suspect) is the actual source of your problem.
fred rosenberger wrote:Hi Yohan,
I edited your post to split up some REALLY long lines...it just makes your whole post easier to read.
I can't give you any specific advice, but I will tell you what we always say in the performance forum.
Get a profiler, and look and see where your program is REALLY spending its time. you can guess all you want, but you will inevitably be wrong. There is no reason to try and speed up some part that isn't really taking any time.
Ulf Dittmer wrote:
Yohan Weerasinghe wrote:The problem here is there are too many root level elements in the XML.
I would phrase it slightly differently: There aren't too many root elements, there is no root element. JSON has no concept of a root element, so the XML class can't provide one. As the javadocs of the XML.toString method says, it creates an XML string, not an XML document. You have to provide the rest.