In the article Internationalizing Servlets, the author states the current PropertyResourceBundle class is less efficient in a multithreaded world (like in J2EE/servlets) because it's based on Hashtable, that has synchronized calls.

Joe Sam Shirah

 

 

Whether the performance hit is worth addressing will depend directly on your site's volume and how often the ResourceBundle elements must be accessed. ListResourceBundle also uses a HashTable and so has the same considerations. It is unfortunate that synchronized methods are used in a read only operation. The article's author does provide an implementation that you are free to use. One downside there is that you end up with two copies of the data, which may or may not be a consideration. This aspect of ResourceBundle, along with the problem of refreshing ( see How can I reload ResourceBundles? ) certainly makes a rewrite of the class appealing.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact