Performance on reading XML

Hello,

At the moment i have a central static Configuration class that contains all the server-specific stuff (like uploads folder, css folder, etc.)

All the items are hardcoded in here.

I want to change this so that the configuration is done inside an xml file that the Configuration class reads.

Now I wanted to ask what the best performance is for this method.

Is it to parse the whole xml file everytime a user sends a request and put the results in Configuration (this means every time a user visits a page alot of non-used parsing time it used)?

Is it to parse the xml file everytime a function inside configuration is called (this means the xml file is parsing to much)?

Or is there any other better way (caching xml file? how to do in tomcat)?

Thanks

[812 byte] By [radicjesa] at [2007-11-27 7:48:28]
# 1
XML parsing is a slow process yes, depending on the amount of data to be parsed of course. Parsing the same XML file over and over again is useless, you can parse it once and keep the information in memory for all users to use.
gimbal2a at 2007-7-12 19:29:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

> XML parsing is a slow process yes, depending on the

> amount of data to be parsed of course. Parsing the

> same XML file over and over again is useless, you can

> parse it once and keep the information in memory for

> all users to use.

Thanks for the answer.

How exactly do I store the information in the memory?

Does this happen automatically?

I am using Tomcat btw

radicjesa at 2007-7-12 19:29:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
anyone knows?
radicjesa at 2007-7-12 19:29:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...