On 7/2/10 2:57 PM, Paul Lindner wrote:
This might be tricky.
You might split the base gadget data structures from the gadgets+view data
structures.
That way these things can stay immutable and be cached more easily.
Invalidation might be tricky though. Watch out for race conditions.
I was thinking that we could move some of the more expensive View
initialization code from the View constructor into a separate init
method, and delay execution of this init method until a View accessor
method is called.
This change would be internal to View.java and would not require any
changes to any of the data structures, but would have the effect of only
initializing a gadget's current view.
Do you still see any potential issues with this?
Thanks,
Jan
On Jul 2, 2010, at 10:33 AM, Jan Luehe wrote:
Currently, when a GadgetSpec is constructed, all of a gadget's (possibly many)
views are initialized (in the View constructor), which includes concatenating
their Content sections and also parsing their PipelinedData tags.
Preferably, we should initialize a view only when it is requested (that is, the gadget's
"current" view).
If there is an interest in this optimization, I will go ahead and prepare a
patch.
Thanks,
Jan