Re: Formatting a date
Keats Kirsch <[email protected]> Mon, 27 Mar 2006 15:51:08 -0500
| Newsgroups | gmane.comp.java.webmacro.user |
|---|---|
| Message-ID | <[email protected]> |
Endre St=F8lsvik wrote: >| I'll also look at making $Text.formatDate cache the SimpleTextFormat o= bjects=20 >| that it creates and run some profiling to see whether or not this is r= eally=20 >| an advantage... > >And where should this cache reside? In which context? Who's gonna clean=20 >it? When? How? (And how do I reload my webapp in Tomcat?) > >Caches on every corner, under every rock, in every creek, and in other=20 >unknown places, is the way to evil code. > =20 > I think your lyrical rejoinder is a bit overstretched. Sometimes=20 caching is good, sometimes it isn't. In this case we are talking about=20 caching a small number or small items, which may be a performance win. =20 Notice that Alex said he would do some testing to see if this is=20 worthwhile. It may not be. We've been reducing the amount of explicit=20 caching in WM as JVMs have become much better at doing this for us. =20 It's difficult to predict when you will see a payoff without testing. In this case the cache could just be a static map inside of the factory=20 class. This optional overhead would be minimal and not interfere with=20 Servlet reloading in any way. Keats >Regards, >Endre. > =20 > ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge that extends applications into web and mobile media. Attend the live webc= ast and join the prime developer group breaking into this new coding territor= y! http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=3D= 121642