File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Is it that use of property files hampers the prformance Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "Is it that use of property files hampers the prformance" Watch "Is it that use of property files hampers the prformance" New topic
Author

Is it that use of property files hampers the prformance

Mrutyunjay Hanchinal
Ranch Hand

Joined: Sep 26, 2001
Posts: 50
HI all
I am planning to use property files in my application, to store the configurable values.
And access the same in servlets with use of ResourceBundle API in servlets.
Does this hamper my application's performance?
I have the other option of having a class that stores the values.
I want to know the mechanism that is used in ResourceBundle. Does this load the property file contents in to the memory or does it do a file operation
Thanks
Mrutyunjay
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

If you are reading the properties file every time you need a property, it will probably be a performance drag.
If the properties never change after the application has started you can try making a cache for the properties in memory and reading from this each time rather than from the harddrive.
Dave


[ JavaRanch FAQ ][ Book Promotions ][ DbTamer ][ BumperStickers ][ JavaRanch Badges ]
Mrutyunjay Hanchinal
Ranch Hand

Joined: Sep 26, 2001
Posts: 50
Hi David
Thanks for the reply.
I want to know the mechanism that is used in ResourceBundle class. Does this read from the hard drive every time a property is requested or does it cache the key value pairs in the memory
Thanks for the reply.
Mrutyunjay
Terence Lewis
Greenhorn

Joined: Mar 16, 2002
Posts: 2
Hi,
In some work I've been doing I've closed my FileInputStream immediately after invoking the load method on my Properties object and found that I can still perform the getProperty operations on my key=value pairs. Wouldn't this suggest that the file is being read into some kind of underlying buffer anway?
Hope this helps in some way.
Terence
 
 
subject: Is it that use of property files hampers the prformance
 
Threads others viewed
.properties vs JNDI
ResourceBundle
Applet always use same Resource file
Does ResourceBundle Cache Automatically?
properties file in websphere
jQuery in Action, 2nd edition