You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Martin Marinschek <ma...@gmail.com> on 2005/11/03 11:17:43 UTC

Re: svn commit: r330515 - /myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java

I wonder if we should make this optional - while we have load tests
currently which show that the problem is processor time, it might be
the case that with a different machine configuration and application
configuration the problem might be memory usage, right?

regards,

Martin

On 11/3/05, mbr@apache.org <mb...@apache.org> wrote:
> Author: mbr
> Date: Thu Nov  3 01:02:29 2005
> New Revision: 330515
>
> URL: http://svn.apache.org/viewcvs?rev=330515&view=rev
> Log:
> state is not longer gzipped if server side state is used to improve performance.
>
> Modified:
>     myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
>
> Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
> URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java?rev=330515&r1=330514&r2=330515&view=diff
> ==============================================================================
> --- myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java (original)
> +++ myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java Thu Nov  3 01:02:29 2005
> @@ -28,12 +28,9 @@
>  import java.util.List;
>  import java.util.Map;
>  import java.util.Set;
> -import java.util.zip.GZIPInputStream;
> -import java.util.zip.GZIPOutputStream;
>
>  import javax.faces.FactoryFinder;
>  import javax.faces.application.StateManager;
> -import javax.faces.application.StateManager.SerializedView;
>  import javax.faces.component.NamingContainer;
>  import javax.faces.component.UIComponent;
>  import javax.faces.component.UIViewRoot;
> @@ -449,7 +446,7 @@
>              ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
>              try
>              {
> -                ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(baos));
> +                ObjectOutputStream out = new ObjectOutputStream(baos);
>                  out.writeObject(serializedView.getStructure());
>                  out.writeObject(serializedView.getState());
>                  out.close();
> @@ -490,8 +487,8 @@
>          {
>              try
>              {
> -                ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
> -                        new ByteArrayInputStream((byte[]) state)));
> +                ObjectInputStream in = new ObjectInputStream(
> +                        new ByteArrayInputStream((byte[]) state));
>                  return new SerializedView(in.readObject(), in.readObject());
>              }
>              catch (IOException e)
>
>
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Re: svn commit: r330515 - /myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java

Posted by Martin van den Bemt <mv...@ibl-software.nl>.
Just serialize the stream to disk to see the gain...
My experience (although with jdk13, serialization was improved after 
that) was that zipping an objectstream actually made a huge difference 
in size..

Mvgr,
Martin

Martin Marinschek wrote:
> Well, I guess that depends on the structure of the binary data.
> 
> So the question is - how much do we gain from this...
> 
> We could find that out easily for the client-side, right?
> 
> regards,
> 
> Martin
> 
> On 11/3/05, Mathias Brökelmann <mb...@googlemail.com> wrote:
> 
>>Yes you are right. But compressing binary data isn´t very effective at all.
>>
>>2005/11/3, Martin Marinschek <ma...@gmail.com>:
>>
>>>I wonder if we should make this optional - while we have load tests
>>>currently which show that the problem is processor time, it might be
>>>the case that with a different machine configuration and application
>>>configuration the problem might be memory usage, right?
>>>
>>>regards,
>>>
>>>Martin
>>>
>>>On 11/3/05, mbr@apache.org <mb...@apache.org> wrote:
>>>
>>>>Author: mbr
>>>>Date: Thu Nov  3 01:02:29 2005
>>>>New Revision: 330515
>>>>
>>>>URL: http://svn.apache.org/viewcvs?rev=330515&view=rev
>>>>Log:
>>>>state is not longer gzipped if server side state is used to improve performance.
>>>>
>>>>Modified:
>>>>    myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
>>>>
>>>>Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
>>>>URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java?rev=330515&r1=330514&r2=330515&view=diff
>>>>==============================================================================
>>>>--- myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java (original)
>>>>+++ myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java Thu Nov  3 01:02:29 2005
>>>>@@ -28,12 +28,9 @@
>>>> import java.util.List;
>>>> import java.util.Map;
>>>> import java.util.Set;
>>>>-import java.util.zip.GZIPInputStream;
>>>>-import java.util.zip.GZIPOutputStream;
>>>>
>>>> import javax.faces.FactoryFinder;
>>>> import javax.faces.application.StateManager;
>>>>-import javax.faces.application.StateManager.SerializedView;
>>>> import javax.faces.component.NamingContainer;
>>>> import javax.faces.component.UIComponent;
>>>> import javax.faces.component.UIViewRoot;
>>>>@@ -449,7 +446,7 @@
>>>>             ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
>>>>             try
>>>>             {
>>>>-                ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(baos));
>>>>+                ObjectOutputStream out = new ObjectOutputStream(baos);
>>>>                 out.writeObject(serializedView.getStructure());
>>>>                 out.writeObject(serializedView.getState());
>>>>                 out.close();
>>>>@@ -490,8 +487,8 @@
>>>>         {
>>>>             try
>>>>             {
>>>>-                ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
>>>>-                        new ByteArrayInputStream((byte[]) state)));
>>>>+                ObjectInputStream in = new ObjectInputStream(
>>>>+                        new ByteArrayInputStream((byte[]) state));
>>>>                 return new SerializedView(in.readObject(), in.readObject());
>>>>             }
>>>>             catch (IOException e)
>>>>
>>>>
>>>>
>>>
>>>
>>>--
>>>
>>>http://www.irian.at
>>>Your JSF powerhouse -
>>>JSF Trainings in English and German
>>>
>>
>>
>>--
>>Mathias
>>
> 
> 
> 
> --
> 
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
> 

Re: svn commit: r330515 - /myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java

Posted by Mathias Brökelmann <mb...@googlemail.com>.
I have run some tests now. Not surprisingly compressed size depends on
the amount of string values in the stream. So I will create an
additional parameter in web.xml to allow the user to switch this on
and off.

2005/11/3, Martin Marinschek <ma...@gmail.com>:
> Well, I guess that depends on the structure of the binary data.
>
> So the question is - how much do we gain from this...
>
> We could find that out easily for the client-side, right?
>
> regards,
>
> Martin
>
> On 11/3/05, Mathias Brökelmann <mb...@googlemail.com> wrote:
> > Yes you are right. But compressing binary data isn´t very effective at all.
> >
> > 2005/11/3, Martin Marinschek <ma...@gmail.com>:
> > > I wonder if we should make this optional - while we have load tests
> > > currently which show that the problem is processor time, it might be
> > > the case that with a different machine configuration and application
> > > configuration the problem might be memory usage, right?
> > >
> > > regards,
> > >
> > > Martin
> > >
> > > On 11/3/05, mbr@apache.org <mb...@apache.org> wrote:
> > > > Author: mbr
> > > > Date: Thu Nov  3 01:02:29 2005
> > > > New Revision: 330515
> > > >
> > > > URL: http://svn.apache.org/viewcvs?rev=330515&view=rev
> > > > Log:
> > > > state is not longer gzipped if server side state is used to improve performance.
> > > >
> > > > Modified:
> > > >     myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
> > > >
> > > > Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
> > > > URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java?rev=330515&r1=330514&r2=330515&view=diff
> > > > ==============================================================================
> > > > --- myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java (original)
> > > > +++ myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java Thu Nov  3 01:02:29 2005
> > > > @@ -28,12 +28,9 @@
> > > >  import java.util.List;
> > > >  import java.util.Map;
> > > >  import java.util.Set;
> > > > -import java.util.zip.GZIPInputStream;
> > > > -import java.util.zip.GZIPOutputStream;
> > > >
> > > >  import javax.faces.FactoryFinder;
> > > >  import javax.faces.application.StateManager;
> > > > -import javax.faces.application.StateManager.SerializedView;
> > > >  import javax.faces.component.NamingContainer;
> > > >  import javax.faces.component.UIComponent;
> > > >  import javax.faces.component.UIViewRoot;
> > > > @@ -449,7 +446,7 @@
> > > >              ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
> > > >              try
> > > >              {
> > > > -                ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(baos));
> > > > +                ObjectOutputStream out = new ObjectOutputStream(baos);
> > > >                  out.writeObject(serializedView.getStructure());
> > > >                  out.writeObject(serializedView.getState());
> > > >                  out.close();
> > > > @@ -490,8 +487,8 @@
> > > >          {
> > > >              try
> > > >              {
> > > > -                ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
> > > > -                        new ByteArrayInputStream((byte[]) state)));
> > > > +                ObjectInputStream in = new ObjectInputStream(
> > > > +                        new ByteArrayInputStream((byte[]) state));
> > > >                  return new SerializedView(in.readObject(), in.readObject());
> > > >              }
> > > >              catch (IOException e)
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > >
> > > http://www.irian.at
> > > Your JSF powerhouse -
> > > JSF Trainings in English and German
> > >
> >
> >
> > --
> > Mathias
> >
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>


--
Mathias

Re: svn commit: r330515 - /myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java

Posted by Martin Marinschek <ma...@gmail.com>.
Well, I guess that depends on the structure of the binary data.

So the question is - how much do we gain from this...

We could find that out easily for the client-side, right?

regards,

Martin

On 11/3/05, Mathias Brökelmann <mb...@googlemail.com> wrote:
> Yes you are right. But compressing binary data isn´t very effective at all.
>
> 2005/11/3, Martin Marinschek <ma...@gmail.com>:
> > I wonder if we should make this optional - while we have load tests
> > currently which show that the problem is processor time, it might be
> > the case that with a different machine configuration and application
> > configuration the problem might be memory usage, right?
> >
> > regards,
> >
> > Martin
> >
> > On 11/3/05, mbr@apache.org <mb...@apache.org> wrote:
> > > Author: mbr
> > > Date: Thu Nov  3 01:02:29 2005
> > > New Revision: 330515
> > >
> > > URL: http://svn.apache.org/viewcvs?rev=330515&view=rev
> > > Log:
> > > state is not longer gzipped if server side state is used to improve performance.
> > >
> > > Modified:
> > >     myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
> > >
> > > Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
> > > URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java?rev=330515&r1=330514&r2=330515&view=diff
> > > ==============================================================================
> > > --- myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java (original)
> > > +++ myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java Thu Nov  3 01:02:29 2005
> > > @@ -28,12 +28,9 @@
> > >  import java.util.List;
> > >  import java.util.Map;
> > >  import java.util.Set;
> > > -import java.util.zip.GZIPInputStream;
> > > -import java.util.zip.GZIPOutputStream;
> > >
> > >  import javax.faces.FactoryFinder;
> > >  import javax.faces.application.StateManager;
> > > -import javax.faces.application.StateManager.SerializedView;
> > >  import javax.faces.component.NamingContainer;
> > >  import javax.faces.component.UIComponent;
> > >  import javax.faces.component.UIViewRoot;
> > > @@ -449,7 +446,7 @@
> > >              ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
> > >              try
> > >              {
> > > -                ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(baos));
> > > +                ObjectOutputStream out = new ObjectOutputStream(baos);
> > >                  out.writeObject(serializedView.getStructure());
> > >                  out.writeObject(serializedView.getState());
> > >                  out.close();
> > > @@ -490,8 +487,8 @@
> > >          {
> > >              try
> > >              {
> > > -                ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
> > > -                        new ByteArrayInputStream((byte[]) state)));
> > > +                ObjectInputStream in = new ObjectInputStream(
> > > +                        new ByteArrayInputStream((byte[]) state));
> > >                  return new SerializedView(in.readObject(), in.readObject());
> > >              }
> > >              catch (IOException e)
> > >
> > >
> > >
> >
> >
> > --
> >
> > http://www.irian.at
> > Your JSF powerhouse -
> > JSF Trainings in English and German
> >
>
>
> --
> Mathias
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Re: svn commit: r330515 - /myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java

Posted by Mathias Brökelmann <mb...@googlemail.com>.
Yes you are right. But compressing binary data isn´t very effective at all.

2005/11/3, Martin Marinschek <ma...@gmail.com>:
> I wonder if we should make this optional - while we have load tests
> currently which show that the problem is processor time, it might be
> the case that with a different machine configuration and application
> configuration the problem might be memory usage, right?
>
> regards,
>
> Martin
>
> On 11/3/05, mbr@apache.org <mb...@apache.org> wrote:
> > Author: mbr
> > Date: Thu Nov  3 01:02:29 2005
> > New Revision: 330515
> >
> > URL: http://svn.apache.org/viewcvs?rev=330515&view=rev
> > Log:
> > state is not longer gzipped if server side state is used to improve performance.
> >
> > Modified:
> >     myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
> >
> > Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
> > URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java?rev=330515&r1=330514&r2=330515&view=diff
> > ==============================================================================
> > --- myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java (original)
> > +++ myfaces/impl/trunk/src/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java Thu Nov  3 01:02:29 2005
> > @@ -28,12 +28,9 @@
> >  import java.util.List;
> >  import java.util.Map;
> >  import java.util.Set;
> > -import java.util.zip.GZIPInputStream;
> > -import java.util.zip.GZIPOutputStream;
> >
> >  import javax.faces.FactoryFinder;
> >  import javax.faces.application.StateManager;
> > -import javax.faces.application.StateManager.SerializedView;
> >  import javax.faces.component.NamingContainer;
> >  import javax.faces.component.UIComponent;
> >  import javax.faces.component.UIViewRoot;
> > @@ -449,7 +446,7 @@
> >              ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
> >              try
> >              {
> > -                ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(baos));
> > +                ObjectOutputStream out = new ObjectOutputStream(baos);
> >                  out.writeObject(serializedView.getStructure());
> >                  out.writeObject(serializedView.getState());
> >                  out.close();
> > @@ -490,8 +487,8 @@
> >          {
> >              try
> >              {
> > -                ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(
> > -                        new ByteArrayInputStream((byte[]) state)));
> > +                ObjectInputStream in = new ObjectInputStream(
> > +                        new ByteArrayInputStream((byte[]) state));
> >                  return new SerializedView(in.readObject(), in.readObject());
> >              }
> >              catch (IOException e)
> >
> >
> >
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>


--
Mathias