Hi

The param "org.apache.myfaces.view.facelets.APPLIED" is used with the web
config param javax.faces.FACELETS_REFRESH_PERIOD, to detect changes on the
template files. If you set this param to 0, facelets stops to add it and
your state size is reduced, so that configuration must be used in production
environments.

I think it is possible to do something about ComponentSupport.MARK_DELETED.
The algorithm used to refresh a view by facelets uses this param to indicate
when a component should be deleted, but I think we can rewrite the algorithm
to do not use the component attribute map to save this information, because
it is only relevant for the current request.

Maybe we should change the keys for example from
"org.apache.myfaces.view.facelets.MARK_DELETED" to something smaller like
"oam.facelets.MARK_DELETED" to save some bytes.

regards,

Leonardo Uribe

2010/6/24 Marius Petoi <[email protected]>

> Hello,
>
> As you said, Martin, the attribute
> "org.apache.myfaces.view.facelets.APPLIED" is included in the partial state.
> This, as well as all the other attributes of the components, as the
> attributeMap in the UIComponentBase is a _ComponentAttributesMap. The put
> method of this map calls afterwards the method in the _DeltaStateHelper.
> This method includes everything in the partial state (as long as the initial
> state is marked). This means that all the attributes of a component will be
> included in the partial state. I suppose that there are other attributes as
> facelets.APPLIED, which don't need to be included in the partial state.
>
> So my suggestion at first would be to add flags to the "put" methods of the
> _DeltaStateHelper, in which to decide whether the value added needs to be in
> the partial state (and therefore added in the _deltas map), or not (in which
> case it will be added only in the _fullstate map). Afterwards, we should
> revise all the attributes and decide whether they need to be in the partial
> state or not and call the put methods with the apropriate flag.
>
> What do you think?
>
> Regards,
> Marius
>
>
> On Wed, Jun 23, 2010 at 4:54 PM, Martin Marinschek <[email protected]
> > wrote:
>
>> Hi Marius,
>>
>> I think you will easily find out candidates for a better
>> implementation - just take a look at the partial state of any of the
>> components. Something that comes immediately to my mind is
>> facelets.MARK_APPLIED - this is only relevant in request-scope, but is
>> currently in the partial state, both in Mojarra and MyFaces (last time
>> I looked).
>>
>> Stuff like this needs to be fixed. Tell us if you have more information.
>>
>> best regards,
>>
>> Martin
>>
>> On 6/18/10, Leonardo Uribe <[email protected]> wrote:
>> > Hi
>> >
>> > I think the key classes are UIComponentBase , _DeltaStateHelper and
>> > _DeltaList. Take a look at UIComponentBase.saveState() and
>> > UIComponentBase.restoreState(). Those methods have calls to other
>> methods
>> > that are critical to state saving. I remember UIViewRoot has other
>> methods
>> > too. I think check those classes are a good point to start.
>> >
>> > regards,
>> >
>> > Leonardo Uribe
>> >
>> > 2010/6/18 Marius Petoi <[email protected]>
>> >
>> >> Hello,
>> >>
>> >> In order to study the current performance of state saving, I designed a
>> >> small page that I included in the examples for MyFaces 2.0. Also, I
>> wrote
>> >> 2
>> >> phase listeners that determine the length of the state saved in the
>> >> ExternalContext before the render response phase and before the restore
>> >> view
>> >> phase. Do you have any suggestions what components should I start
>> >> analyzing
>> >> the state for?
>> >>
>> >> Regards,
>> >> Marius
>> >>
>> >
>>
>>
>> --
>>
>> http://www.irian.at
>>
>> Your JSF powerhouse -
>> JSF Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>
>

Reply via email to