Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it that use of property files hampers the prformance  RSS feed

 
Mrutyunjay Hanchinal
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mrutyunjay Hanchinal
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!