i18n and Servlet performance
1 posts in topic
Flat View  Flat View

Posted By:   Jeff_Bobier
Posted On:   Tuesday, November 13, 2001 06:54 AM

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.

Does anyone knows the real performance hit? Are ListResourceBundle classes OK for servlets? Must I also write a custom class like the example in the article to cope with that?

Re: i18n and Servlet performance

Posted By:   Anonymous  
Posted On:   Thursday, November 29, 2001 10:13 AM

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.
About | Sitemap | Contact