Yesterday I was building an application which was parsing xml files, after writing xml parsing code using XML API provided by JAVA, I found that my application is taking so much amount of time to parse a single file!!!
But when I wrote a simple XML file and parsed it using my application, it parsed within a second.
After reading xml files which I needed to parse I found that, those were containing DTD definition on web, and that was the reason why my application was taking so much amount of time to parse them.
So I changed my code for parsing xml in which I disabled DTD lookup on web. So while building an application which parses xml files, disable DTD lookup until you really need to follow them.
This will surely increase performance of your application.
But when I wrote a simple XML file and parsed it using my application, it parsed within a second.
After reading xml files which I needed to parse I found that, those were containing DTD definition on web, and that was the reason why my application was taking so much amount of time to parse them.
So I changed my code for parsing xml in which I disabled DTD lookup on web. So while building an application which parses xml files, disable DTD lookup until you really need to follow them.
This will surely increase performance of your application.
Comments
Post a Comment