Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 33662 invoked from network); 15 Jul 2010 05:39:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Jul 2010 05:39:41 -0000 Received: (qmail 61721 invoked by uid 500); 15 Jul 2010 05:39:41 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 61290 invoked by uid 500); 15 Jul 2010 05:39:38 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 61283 invoked by uid 99); 15 Jul 2010 05:39:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jul 2010 05:39:36 +0000 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lu4242@gmail.com designates 209.85.212.181 as permitted sender) Received: from [209.85.212.181] (HELO mail-px0-f181.google.com) (209.85.212.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jul 2010 05:39:29 +0000 Received: by pxi19 with SMTP id 19so321027pxi.12 for ; Wed, 14 Jul 2010 22:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=AQUf6rUs7Wm6Ud672Nc2F218OBfbhsa6W2E3l8EhxvM=; b=vVmMk0DxhFpUkhZXyMofhCIV2Et3rDMD+xI8E4dg8VFLkKDGbImEs9R8PjzOE7lO4B 566eukc9LjkMyZQi+nZnGoPMcqpUkH4lCAmpjLFo65ZOY37d7sj1xXZiiSnjr3yKDHqH d4SWbIpHWzi/ewA/QwolEoXcabu8YXMntU2iA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AxurcYfoq4w5uPK/sjjJIKOrxILit2h35lCETpWsHQ2JpXwgNhF7obhIcPBJT5eM/b ZHdH+pXVWCNQ/rbsr4OQ8rM8udrAJGoKrFW1OBaNCUqhbkOQNhnq5QbgoiHAmRjHWAdM 4V2/zG5uKxNWeQ1vnm+krwIhahnGvJZzB/HHo= MIME-Version: 1.0 Received: by 10.142.188.13 with SMTP id l13mr21103345wff.126.1279172287758; Wed, 14 Jul 2010 22:38:07 -0700 (PDT) Received: by 10.142.88.19 with HTTP; Wed, 14 Jul 2010 22:38:07 -0700 (PDT) In-Reply-To: References: <73B977EA-539E-41EC-880B-BF3979B192C1@gmail.com> Date: Thu, 15 Jul 2010 00:38:07 -0500 Message-ID: Subject: Re: [GSOC] State saving performance improvements in MyFaces 2.0 From: Leonardo Uribe To: MyFaces Development Content-Type: multipart/alternative; boundary=000e0cd28d38d183af048b66813a X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd28d38d183af048b66813a Content-Type: text/plain; charset=ISO-8859-1 Hi Marius 2010/7/13 Marius Petoi > Hi Leonardo, > > I corrected the things you required in the JIRA issues. When you have the > time, please have a look over them. See inline my comments and questions: > > On Sun, Jul 11, 2010 at 3:57 AM, Leonardo Uribe wrote: > >> Hi >> >> Sorry for the late response, but I was looking other important issues (I >> usually review issues with JSR-314 component first). I reviewed your patches >> and I committed some of them, and made comments on the others. >> >> > On the other hand, regarding serialization vs implements >>>> PartialStateHolder, >>>> > I've looked for some more externalizable objects: the >>>> TagMethodExpression >>>> > class is used in the MethodExpressionValueChangeListener, which >>>> implements >>>> > StateHolder and PartialMethodExpressionValueChangeListener, which >>>> implements >>>> > PartialStateHolder. >>>> >>>> > So maybe instead of being Externalizable, >>>> > TagMethodExpression should also implement PartialStateHolder. There is >>>> a >>>> > similar situation with TagValueExpression. >>>> >>>> I guess - Leonardo should clarify. >>>> >>>> >> To save ValueExpressions, javax.faces.component._DeltaStateHelper uses an >> InternalMap, but that one does not take into account PartialStateHolder >> interface. So in this case does not apply. >> >> In MethodExpression it is possible, but to do that, we need to solve two >> questions: >> >> - If we have an immutable object that implements Serializable interface >> and a similar one that implements PartialStateHolder, which one is saved / >> restored faster? which one has bigger state size? It is worth to implement >> PartialStateHolder or keep it as Serializable?. To solve that we need to try >> some simple performance tests with possible candidates. >> > > --> Ok. How should I do that. This meaning do you have any suggestions for > objects or should I create some mock objects with identical data and then > compare the two strategies (in time and state size)? > Yes, it is a simple check but the important here is to know if the optimization is valuable or not. > >> - Does all methods that store MethodExpression variables ( >> UICommand.actionExpression) should handle PartialStateHolder interfaces? In >> theory yes (I add this support before but then I revert it to the current >> behavior because there is no evidence why use PartialStateHolder in this >> case), but if we don't expect MethodExpression implementations implements >> PartialStateHolder, just let it as is. >> > > --> By this you mean classes with MethodExpressions that use also > serialization and not implements PartialStateHolder. I've found a couple of > such classes: EventHandler.Listener and LegacyMethodBinding. > Yes. Note here to implement PartialStateHolder the target property that will use the MethodExpression should know how to deal with it. But this is worth only if the first idea is also true ( implement PartialStateHolder instead Serializable ). > >> Look this class: >> org.apache.myfaces.view.facelets.tag.jsf.core.SetPropertyActionListenerHandler >> . It has a inner class called SetPropertyListener that implements >> Serializable. javax.faces.component._DeltaList is used to store >> FacesListeners and that one handles PartialStateHolder instances. That one >> is other valid case. >> > > --> Ok. So should I transform this class into one implementing > PartialStateHolder? > In this case you should evaluate if it is worth this class implements PartialStateHolder. regards, Leonardo > >> best regards, >> >> Leonardo Uribe >> > > Regards, > Marius > > --000e0cd28d38d183af048b66813a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Marius

2010/7/13 Marius Petoi <marius.petoi@code= beat.ro>
Hi Leonardo,

I corrected the things you required in the JIRA issues.= When you have the time, please have a look over them. See inline my commen= ts and questions:

On Su= n, Jul 11, 2010 at 3:57 AM, Leonardo Uribe <lu4242@gmail.com>= wrote:
Hi

Sorry f= or the late response, but I was looking other important issues (I usually r= eview issues with JSR-314 component first). I reviewed your patches and I c= ommitted some of them, and made comments on the others.

> On the other hand, regarding serialization vs implements PartialStateH= older,
> I've looked for some more externalizable objects: the TagMethodExp= ression
> class is used in the MethodExpressionValueChangeListener, which implem= ents
> StateHolder and PartialMethodExpressionValueChangeListener, which impl= ements
> PartialStateHolder.

> So maybe instead of being Externalizable,
> TagMethodExpression should also implement PartialStateHolder. There is= a
> similar situation with TagValueExpression.

I guess - Leonardo should clarify.


= To save ValueExpressions, javax.faces.component._DeltaStateHelper uses an I= nternalMap, but that one does not take into account PartialStateHolder inte= rface. So in this case does not apply.

In MethodExpression it is possible, but to do that, we need to solve tw= o questions:

- If we have an immutable object that implements Serial= izable interface and a similar one that implements PartialStateHolder, whic= h one is saved / restored faster? which one has bigger state size? It is wo= rth to implement PartialStateHolder or keep it as Serializable?. To solve t= hat we need to try some simple performance tests with possible candidates.<= br>

--> Ok. How should I do that. This meaning d= o you have any=20 suggestions for objects or should I create some mock objects with identical= data and then compare the two strategies (in time and state size)?

Yes, it is a simple check but the important h= ere is to know if the optimization is valuable or not.
=A0

- Does all methods that store MethodExpression variables ( UICommand.ac= tionExpression) should handle PartialStateHolder interfaces? In theory yes = (I add this support before but then I revert it to the current behavior bec= ause there is no evidence why use PartialStateHolder in this case), but if = we don't expect MethodExpression implementations implements PartialStat= eHolder, just let it as is.

--> By this you mean classes with MethodExpr= essions that use also serialization and not implements PartialStateHolder. = I've found a couple of such classes: EventHandler.Listener and LegacyMe= thodBinding.

Yes. Note here to implement PartialStateH= older the target property that will use the MethodExpression should know ho= w to deal with it. But this is worth only if the first idea is also true ( = implement PartialStateHolder instead Serializable ).
=A0

Look this class: org.apache.myfaces.view.facelets.tag.jsf.core.SetPrope= rtyActionListenerHandler . It has a inner class called SetPropertyListener = that implements Serializable. javax.faces.component._DeltaList is used to s= tore FacesListeners and that one handles PartialStateHolder instances. That= one is other valid case.

--> Ok. So should I transform this class int= o one implementing PartialStateHolder?
In this case you should evaluate if it is worth this class implements Par= tialStateHolder.

regards,

Leonardo
=A0

best regards,

Leonardo Uribe
<= /blockquote>

Regards,
Marius


--000e0cd28d38d183af048b66813a--