XML : Parsing external XML files in JAR - poor performance

I am working on a Java based desktop application that is built using Swing. I have a local database that contains 16 XML files of sizes 750 KB each. For parsing these files, I compared performance between DOM based parser vs StAX based parser (both built-in). I didn't notice any difference in my case.

Now, when I run this application in Eclipse IDE and when my program parses all of these files, it takes about 100 milliseconds. I packaged this application as a JAR file with a database directory on the same level as the JAR file (so the database is external to the JAR). I ran the JAR file and my application parsed the same database in an average time of 6000 milliseconds. I tried ran it about 20-30 times but it averaged about same.

I am wondering what could be the reason why there is such a huge performance difference in these two cases? Every single line of code is the same in both cases. I can post the code if needed but I just do not think that is the problem here. Thanks!

No comments:

Post a Comment