Just spent some time tracking down a slow request and finally found
out it's caused by S.?
Changing
protected def _valueToDisplayString(v:ENUM#Value) =
S.?(enum.toString+"."+v.toString)
to
private object nameCache extends RequestMemoize[String,String]
protected def _valueToDisplayString(v:ENUM#Value) = {
val key = enum.toString+"."+v.toString
nameCache.get(key, S.?(key))
}
results in a drop in response time from 2.5s to about 250ms.
Now, this is probably an unusual case (rendering 3500 rows each with 4
lookups), but is there any reason _not_ to cache the result of a
resource (key,locale) lookup when running in production?
/Jeppe
/Jeppe
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
This would provide a way to selectively override core properties
without having to maintain the whole file....
/Jeppe
On Thu, Mar 1, 2012 at 6:13 PM, David Pollak
<feeder.of...@gmail.com> wrote:
How about deprecating ?? and just add the core resource bundle at the
end of the ? bundles?
This would provide a way to selectively override core properties
without having to maintain the whole file....