You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Ronald Muller <ro...@gmail.com> on 2011/01/24 13:46:05 UTC

Using ProGuard

Hallo,

Has someone succeeded using ProGuard to reduce the size of pivot
applets? If so, are you willing to share the configuration?

Regards,

Ronald

Re: Using ProGuard

Posted by Greg Brown <gk...@verizon.net>.
>>> Agree, the JRE is great, but not so great at client side. Today i
>>> studied pivot, my browser crashed several times (FF3 / GC8) and that
>>> is not making me happy.
>> 
>> What OS are you using?

> Ubuntu 10.04LTS

Ah, well then you are just asking for trouble.  ;-)  There seem to be quite a few issues with the plugin implementations on Linux.

> BTW (based on 1 day experience...) the pivot API looks nice and you
> are very fast "up and running".

Glad to hear it.

G


Re: Using ProGuard

Posted by Ronald Muller <ro...@gmail.com>.
Ubuntu 10.04LTS

BTW (based on 1 day experience...) the pivot API looks nice and you
are very fast "up and running".

Ronald

2011/1/24 Greg Brown <gk...@verizon.net>:
>>> Unfortunately, Pivot also requires a JRE (~15MB), and it isn't currently possible to download and install only the JRE features that Pivot needs. Hopefully this will change when Project Jigsaw is released in Java 8.
>> Agree, the JRE is great, but not so great at client side. Today i
>> studied pivot, my browser crashed several times (FF3 / GC8) and that
>> is not making me happy.
>
> What OS are you using?
>
> FWIW, this is just one of the reasons Pivot 2.0 is being touted as an "IIA" framework vs. "RIA". I think you'll find that client-side Java itself is not the problem, but rather the Java plugin.
>
> G
>
>

Re: Using ProGuard

Posted by Greg Brown <gk...@verizon.net>.
>> Unfortunately, Pivot also requires a JRE (~15MB), and it isn't currently possible to download and install only the JRE features that Pivot needs. Hopefully this will change when Project Jigsaw is released in Java 8.
> Agree, the JRE is great, but not so great at client side. Today i
> studied pivot, my browser crashed several times (FF3 / GC8) and that
> is not making me happy.

What OS are you using?

FWIW, this is just one of the reasons Pivot 2.0 is being touted as an "IIA" framework vs. "RIA". I think you'll find that client-side Java itself is not the problem, but rather the Java plugin.

G


Re: Using ProGuard

Posted by Ronald Muller <ro...@gmail.com>.
2011/1/24 Greg Brown <gk...@verizon.net>:
> There has to be some sort of runtime (specifically, the GWT platform classes that your app uses). I assume that this is simply packaged up as part of your app.
That is right.
 I'd guess that the "runtime" in this case can be much smaller than
Pivot's JARs because it relies heavily on functionality that is
already built into the browser. With the exception of the drawing
primitives provided by Java2D, Pivot's UI is implemented entirely in
the platform JARs - given that, I'd say that 2MB (including debug
info) is pretty small.  :-)
That is pretty small yes, but it is 10x more than GWT :)
>
> Unfortunately, Pivot also requires a JRE (~15MB), and it isn't currently possible to download and install only the JRE features that Pivot needs. Hopefully this will change when Project Jigsaw is released in Java 8.
Agree, the JRE is great, but not so great at client side. Today i
studied pivot, my browser crashed several times (FF3 / GC8) and that
is not making me happy.
>
> G
>
> On Jan 24, 2011, at 9:37 AM, Ronald Muller wrote:
>
>> Thanks Chris and Greg!
>>
>> @Greg A GWT app is (when served to the client browser) "just" plain
>> optimized and obfuscated javascript. Best practice is to gzip these
>> files. There is no such thing as a "runtime". GWT does a *very* good
>> job in optimizing the javascript code. In our app the (gziped) js
>> files are about 200k. These files are also cached (forever) client
>> side. My first *very simple* pivot app is about 10x larger. I do not
>> say this is a real problem, i am just comparing
>>
>> @Chris Yes I already tried to proguard the hellojava app. No success
>> so far. So that is why i asked. And yes, the BeanAdapter is mainly
>> giving the problems. I also run in LocalVariableTypeTable attribute
>> problems ... I wonder if it is worth the effort :)
>>
>> Ronald
>>
>> 2011/1/24 Greg Brown <gk...@verizon.net>:
>>> Yes, reflection occurs primarily in BeanAdapter and BXMLSerializer.
>>> On Jan 24, 2011, at 8:32 AM, Chris Bartlett wrote:
>>>
>>> Ronald,
>>>
>>> This is something that I have on my 'to investigate' list, but have not
>>> required it yet. It has been a while since I used ProGuard too, so I have
>>> probably forgotten everything I ever knew!
>>> Have you attempted to use it for shrinking yet, or were you just wondering
>>> if there is a profile available for Pivot?
>>> I think I am right in saying that all reflection in Pivot occurs through the
>>> BeanAdapter class, but perhaps Greg can confirm?
>>> You will need to be careful with the WTK & Terra jars as they are commonly
>>> accessed with BeanAdapter.  If you don't intend to use BXML to specify your
>>> GUI, then more of WTK could be shrunk, but the skins would still need the
>>> names of their styles (bean properties) to remain unchanged.
>>> BeanAdapter is used in a number of places, some of which are mentioned at
>>> the beginning of this email.
>>>  http://apache-pivot-developers.417237.n3.nabble.com/Some-thoughts-on-BeanAdapter-tp2309139p2309139.html
>>> Chris
>>> On 24 January 2011 19:46, Ronald Muller <ro...@gmail.com> wrote:
>>>>
>>>> Hallo,
>>>>
>>>> Has someone succeeded using ProGuard to reduce the size of pivot
>>>> applets? If so, are you willing to share the configuration?
>>>>
>>>> Regards,
>>>>
>>>> Ronald
>>>
>>>
>>>
>
>

Re: Using ProGuard

Posted by Greg Brown <gk...@verizon.net>.
There has to be some sort of runtime (specifically, the GWT platform classes that your app uses). I assume that this is simply packaged up as part of your app. I'd guess that the "runtime" in this case can be much smaller than Pivot's JARs because it relies heavily on functionality that is already built into the browser. With the exception of the drawing primitives provided by Java2D, Pivot's UI is implemented entirely in the platform JARs - given that, I'd say that 2MB (including debug info) is pretty small.  :-)  

Unfortunately, Pivot also requires a JRE (~15MB), and it isn't currently possible to download and install only the JRE features that Pivot needs. Hopefully this will change when Project Jigsaw is released in Java 8.

G

On Jan 24, 2011, at 9:37 AM, Ronald Muller wrote:

> Thanks Chris and Greg!
> 
> @Greg A GWT app is (when served to the client browser) "just" plain
> optimized and obfuscated javascript. Best practice is to gzip these
> files. There is no such thing as a "runtime". GWT does a *very* good
> job in optimizing the javascript code. In our app the (gziped) js
> files are about 200k. These files are also cached (forever) client
> side. My first *very simple* pivot app is about 10x larger. I do not
> say this is a real problem, i am just comparing
> 
> @Chris Yes I already tried to proguard the hellojava app. No success
> so far. So that is why i asked. And yes, the BeanAdapter is mainly
> giving the problems. I also run in LocalVariableTypeTable attribute
> problems ... I wonder if it is worth the effort :)
> 
> Ronald
> 
> 2011/1/24 Greg Brown <gk...@verizon.net>:
>> Yes, reflection occurs primarily in BeanAdapter and BXMLSerializer.
>> On Jan 24, 2011, at 8:32 AM, Chris Bartlett wrote:
>> 
>> Ronald,
>> 
>> This is something that I have on my 'to investigate' list, but have not
>> required it yet. It has been a while since I used ProGuard too, so I have
>> probably forgotten everything I ever knew!
>> Have you attempted to use it for shrinking yet, or were you just wondering
>> if there is a profile available for Pivot?
>> I think I am right in saying that all reflection in Pivot occurs through the
>> BeanAdapter class, but perhaps Greg can confirm?
>> You will need to be careful with the WTK & Terra jars as they are commonly
>> accessed with BeanAdapter.  If you don't intend to use BXML to specify your
>> GUI, then more of WTK could be shrunk, but the skins would still need the
>> names of their styles (bean properties) to remain unchanged.
>> BeanAdapter is used in a number of places, some of which are mentioned at
>> the beginning of this email.
>>  http://apache-pivot-developers.417237.n3.nabble.com/Some-thoughts-on-BeanAdapter-tp2309139p2309139.html
>> Chris
>> On 24 January 2011 19:46, Ronald Muller <ro...@gmail.com> wrote:
>>> 
>>> Hallo,
>>> 
>>> Has someone succeeded using ProGuard to reduce the size of pivot
>>> applets? If so, are you willing to share the configuration?
>>> 
>>> Regards,
>>> 
>>> Ronald
>> 
>> 
>> 


Re: Using ProGuard

Posted by Ronald Muller <ro...@gmail.com>.
Thanks Chris and Greg!

@Greg A GWT app is (when served to the client browser) "just" plain
optimized and obfuscated javascript. Best practice is to gzip these
files. There is no such thing as a "runtime". GWT does a *very* good
job in optimizing the javascript code. In our app the (gziped) js
files are about 200k. These files are also cached (forever) client
side. My first *very simple* pivot app is about 10x larger. I do not
say this is a real problem, i am just comparing

@Chris Yes I already tried to proguard the hellojava app. No success
so far. So that is why i asked. And yes, the BeanAdapter is mainly
giving the problems. I also run in LocalVariableTypeTable attribute
problems ... I wonder if it is worth the effort :)

Ronald

2011/1/24 Greg Brown <gk...@verizon.net>:
> Yes, reflection occurs primarily in BeanAdapter and BXMLSerializer.
> On Jan 24, 2011, at 8:32 AM, Chris Bartlett wrote:
>
> Ronald,
>
> This is something that I have on my 'to investigate' list, but have not
> required it yet. It has been a while since I used ProGuard too, so I have
> probably forgotten everything I ever knew!
> Have you attempted to use it for shrinking yet, or were you just wondering
> if there is a profile available for Pivot?
> I think I am right in saying that all reflection in Pivot occurs through the
> BeanAdapter class, but perhaps Greg can confirm?
> You will need to be careful with the WTK & Terra jars as they are commonly
> accessed with BeanAdapter.  If you don't intend to use BXML to specify your
> GUI, then more of WTK could be shrunk, but the skins would still need the
> names of their styles (bean properties) to remain unchanged.
> BeanAdapter is used in a number of places, some of which are mentioned at
> the beginning of this email.
>  http://apache-pivot-developers.417237.n3.nabble.com/Some-thoughts-on-BeanAdapter-tp2309139p2309139.html
> Chris
> On 24 January 2011 19:46, Ronald Muller <ro...@gmail.com> wrote:
>>
>> Hallo,
>>
>> Has someone succeeded using ProGuard to reduce the size of pivot
>> applets? If so, are you willing to share the configuration?
>>
>> Regards,
>>
>> Ronald
>
>
>

Re: Using ProGuard

Posted by Greg Brown <gk...@verizon.net>.
Yes, reflection occurs primarily in BeanAdapter and BXMLSerializer.

On Jan 24, 2011, at 8:32 AM, Chris Bartlett wrote:

> Ronald,
> 
> This is something that I have on my 'to investigate' list, but have not required it yet. It has been a while since I used ProGuard too, so I have probably forgotten everything I ever knew!
> 
> Have you attempted to use it for shrinking yet, or were you just wondering if there is a profile available for Pivot?
> 
> I think I am right in saying that all reflection in Pivot occurs through the BeanAdapter class, but perhaps Greg can confirm?  
> 
> You will need to be careful with the WTK & Terra jars as they are commonly accessed with BeanAdapter.  If you don't intend to use BXML to specify your GUI, then more of WTK could be shrunk, but the skins would still need the names of their styles (bean properties) to remain unchanged.
> 
> BeanAdapter is used in a number of places, some of which are mentioned at the beginning of this email.  http://apache-pivot-developers.417237.n3.nabble.com/Some-thoughts-on-BeanAdapter-tp2309139p2309139.html
> 
> Chris
> 
> On 24 January 2011 19:46, Ronald Muller <ro...@gmail.com> wrote:
> Hallo,
> 
> Has someone succeeded using ProGuard to reduce the size of pivot
> applets? If so, are you willing to share the configuration?
> 
> Regards,
> 
> Ronald
> 


Re: Using ProGuard

Posted by Chris Bartlett <cb...@gmail.com>.
Ronald,

This is something that I have on my 'to investigate' list, but have not
required it yet. It has been a while since I used ProGuard too, so I have
probably forgotten everything I ever knew!

Have you attempted to use it for shrinking yet, or were you just wondering
if there is a profile available for Pivot?

I think I am right in saying that all reflection in Pivot occurs through the
BeanAdapter class, but perhaps Greg can confirm?

You will need to be careful with the WTK & Terra jars as they are commonly
accessed with BeanAdapter.  If you don't intend to use BXML to specify your
GUI, then more of WTK could be shrunk, but the skins would still need the
names of their styles (bean properties) to remain unchanged.

BeanAdapter is used in a number of places, some of which are mentioned at
the beginning of this email.
http://apache-pivot-developers.417237.n3.nabble.com/Some-thoughts-on-BeanAdapter-tp2309139p2309139.html

Chris

On 24 January 2011 19:46, Ronald Muller <ro...@gmail.com> wrote:

> Hallo,
>
> Has someone succeeded using ProGuard to reduce the size of pivot
> applets? If so, are you willing to share the configuration?
>
> Regards,
>
> Ronald
>

Re: Using ProGuard

Posted by Greg Brown <gk...@verizon.net>.
OK. It has been a while since I worked with GWT - does that size include the GWT runtime? Also, you are deploying this archive to a server, correct? To perform an "apples to apples" comparison, you'd really want to look at the size of the uncompressed application, as delivered to the end user.

But either way, the Pivot libraries are still pretty small (~2MB), and they get cached by the Java plugin. So your users only need to download them once. The same applies to your application JAR(s).

G

On Jan 24, 2011, at 8:15 AM, Ronald Muller wrote:

> The size is no problem at this moment. I am totally new to pivot (but
> experienced with GWT and Swing). I am evaluating pivot for a new
> project, so I am mainly comparing with GWT. Our current mid-size GWT
> application is much smaller (gzipped) than the total size of the pivot
> jar's. To have a "fair" baseline i was thinking about proguarding the
> pivot app. But that turns out to be not so easy ...
> 
> Regards,
> 
> Ronald
> 
> 2011/1/24 Greg Brown <gk...@verizon.net>:
>> Have you found the size of Pivot applets to be a problem? The platform JARs are not terribly large and application JARs (from my experience) tend to be even smaller. However, their size could easily be reduced further by removing debug info.
>> G
>> 
>> On Jan 24, 2011, at 7:46 AM, Ronald Muller wrote:
>> 
>>> Hallo,
>>> 
>>> Has someone succeeded using ProGuard to reduce the size of pivot
>>> applets? If so, are you willing to share the configuration?
>>> 
>>> Regards,
>>> 
>>> Ronald
>> 
>> 


Re: Using ProGuard

Posted by Ronald Muller <ro...@gmail.com>.
The size is no problem at this moment. I am totally new to pivot (but
experienced with GWT and Swing). I am evaluating pivot for a new
project, so I am mainly comparing with GWT. Our current mid-size GWT
application is much smaller (gzipped) than the total size of the pivot
jar's. To have a "fair" baseline i was thinking about proguarding the
pivot app. But that turns out to be not so easy ...

Regards,

Ronald

2011/1/24 Greg Brown <gk...@verizon.net>:
> Have you found the size of Pivot applets to be a problem? The platform JARs are not terribly large and application JARs (from my experience) tend to be even smaller. However, their size could easily be reduced further by removing debug info.
> G
>
> On Jan 24, 2011, at 7:46 AM, Ronald Muller wrote:
>
>> Hallo,
>>
>> Has someone succeeded using ProGuard to reduce the size of pivot
>> applets? If so, are you willing to share the configuration?
>>
>> Regards,
>>
>> Ronald
>
>

Re: Using ProGuard

Posted by Greg Brown <gk...@verizon.net>.
Have you found the size of Pivot applets to be a problem? The platform JARs are not terribly large and application JARs (from my experience) tend to be even smaller. However, their size could easily be reduced further by removing debug info.
G

On Jan 24, 2011, at 7:46 AM, Ronald Muller wrote:

> Hallo,
> 
> Has someone succeeded using ProGuard to reduce the size of pivot
> applets? If so, are you willing to share the configuration?
> 
> Regards,
> 
> Ronald