Community
Participate
Working Groups
Forked from bug 232413. Currently each time a translated string is looked up, it requires a query across every available repository. We should be able to cache these queries to avoid querying the entire world on each string lookup. For example, we could remember the collection of IUs that contribute values for a given locale, so that when doing a lookup in that locale, we only query the subset of IUs relevant for that locale.
Created attachment 101591 [details] Cache localization fragments in a soft ref
Access to the value of the soft reference should cache the result to avoid a potential GC (line 164) if (collectorRef != null && collectorRef.get() != null) return (Collector) collectorRef.get(); should become if (collectorRef != null) { Collector result = (Collector) collectorRef.get(); if (result != null) return result; }
Created attachment 101607 [details] Avoid gc when getting cached localization fragments from soft ref New caching patch with Pascal's suggestion to avoid gc when getting value from the soft reference.
+1 One other little improvement is to break out of the outer most loop in localeFragmentCollector query since we know for sure that the IU is good (line 183).
forget my latest comment.
+1 for this patch, although unfortunately it doesn't seem to give me a big speedup. I think we have a bug in our update site caching. Whenever I test this, if I suspend I see feature jars being downloaded during update site generation, even though I am running with sites I have browsed many times in previous sessions. Patch released.