Re: [gwt-contrib] GWT 2.5 RC1 increases mgwt showcase by 22%

2012-09-12 Thread Ray Cromwell
I'm bogged down at the moment, but when I get free time, I can
probably figure this out via -Dgwt.jjs.traceMethod on the client
bundle in question. Probably will have to wait a few days.


On Wed, Sep 12, 2012 at 4:04 PM, Daniel Kurka  wrote:
> Hi Ray, hi John,
>
> I haven`t had the time to track down why this got optimized in 2.4 but does 
> not in 2.5 anymore. We are seeing huge gains on many different mgwt apps with 
> GWT 2.5.
>
> @John
> With mobile browsers you get a lot of small inconsistencies across many 
> different places. I initially went ahead and build an interface with 
> different implementations and used deferred binding in the gwt.xml file.
> The problem was the amount of overhead you had to do for a simple one liner. 
> So I went ahead and used a Generator to build an interface that is based on a 
> property provider. The interface basically just returns true or false.
>
> All the stuff used to compile out in gwt 2.2 so we could do something like:
>
> if(MGWT.getIsDetection().isIphone()){
> //do some small workaround
> }
>
> So right now we have a lot of places where we use those one liners to fix 
> things. (we also use a lot of deferred binding as well).
>
> @Ray
> I am really interested in knowing why this used to work and right now it 
> doesn't.
> I just went ahead and changed the code inside the client bundle to cache an 
> instance of OsDetection to get around the clinit.
>
> OsDetection detection = MGWT.getOsDetection();
>
> if (detection.isAndroidPhone()) {
>   bundle = GWT.create(MGWTClientBundleBaseThemeAndroid.class);
> }
>
> if (detection.isAndroidTablet()) {
>   bundle = GWT.create(MGWTClientBundleBaseThemeAndroidTablet.class);
> }
>
> This actually dropped code size of more than 29%. I think we got a lot of 
> places still being affected by this change, but at this point I can go 
> through the codebase and apply the workaround or even decide to bite some 
> bullets on more direct deferred binding. The thing I am still wondering about 
> what broke that we do see this problem now. I could offer some work time to 
> go and build every version between GWT 2.5rc1 and GWT 2.4 to get a better 
> feeling for what the actual commit is and if this is something we need to 
> look further?! What do you think?
>
> -Daniel
>
>
>
>
>
>
>
>
>
>
>
> Am 12.09.2012 um 00:03 schrieb Ray Cromwell :
>
>> I finally tracked this down, it appears Android client bundles are not
>> being optimized out of the Iphone build, for example. This code:
>>
>> public MGWTThemeBaseThemeStandardImpl() {
>>
>>   if (MGWT.getOsDetection().isAndroidPhone()) {
>>   bundle = 
>> GWT.create(MGWTClientBundleBaseThemeAndroid.class);
>>   }
>>
>>   if (MGWT.getOsDetection().isAndroidTablet()) {
>>   bundle = 
>> GWT.create(MGWTClientBundleBaseThemeAndroidTablet.class);
>>   }
>>
>>   if (MGWT.getOsDetection().isIPhone()) {
>>   if (MGWT.getOsDetection().isRetina()) {
>>   bundle = 
>> GWT.create(MGWTClientBundleBaseThemeRetina.class);
>>   } else {
>>   bundle = 
>> GWT.create(MGWTClientBundleBaseThemeIPhone.class);
>>   }
>>   }
>>
>>   if (MGWT.getOsDetection().isIPad()) {
>>   if (MGWT.getOsDetection().isIPadRetina()) {
>>   bundle = 
>> GWT.create(MGWTClientBundleBaseThemeIPadRetina.class);
>>   } else {
>>   bundle = 
>> GWT.create(MGWTClientBundleBaseThemeIPad.class);
>>   }
>>
>>   }
>> ...
>> }
>>
>> on GWT 2.5 is optimized into:
>>
>> function MGWTThemeBaseThemeStandardImpl_0(){
>>  ($clinit_MGWT() , false) && (this.bundle = new
>> MGWTClientBundleBaseThemeAndroid_iphone_safari_default_InlineClientBundleGenerator_0);
>>  this.bundle = new
>> MGWTClientBundleBaseThemeIPhone_iphone_safari_default_InlineClientBundleGenerator_0;
>> }
>>
>> This is essentially if(false) { android bundle}
>>
>> I'm a little perplexed since the compiler has never really optimized
>> stuff like (clinit(), boolean) && blah, since it would need to hoist
>> the clinit() out of there which it doesn't do yet. I probably won't be
>> able to fix this for 2.5, but one workaround is to inline the
>> GWT.create(OsDetection) into the bundle theme and avoid calling MGWT
>> (which has a non-empty clinit)
>>
>>
>> On Sun, Jul 29, 2012 at 8:16 AM, Daniel Kurka  wrote:
>>> I didn't have the time yet to build a test case without mgwt put here is a
>>> very basic entry point.
>>>
>>> Compiled with GWT 2.4 its around 30k with GWT 2.5-rc its 45k (many styles
>>> not being removed):
>>>
>>> I have attached an entrypoint which can be run with the latest mgwt jar in
>>> the classpath:
>>> https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&

Re: [gwt-contrib] GWT 2.5 RC1 increases mgwt showcase by 22%

2012-09-12 Thread Daniel Kurka
Hi Ray, hi John,

I haven`t had the time to track down why this got optimized in 2.4 but does not 
in 2.5 anymore. We are seeing huge gains on many different mgwt apps with GWT 
2.5.

@John
With mobile browsers you get a lot of small inconsistencies across many 
different places. I initially went ahead and build an interface with different 
implementations and used deferred binding in the gwt.xml file.
The problem was the amount of overhead you had to do for a simple one liner. So 
I went ahead and used a Generator to build an interface that is based on a 
property provider. The interface basically just returns true or false.

All the stuff used to compile out in gwt 2.2 so we could do something like:

if(MGWT.getIsDetection().isIphone()){
//do some small workaround
}

So right now we have a lot of places where we use those one liners to fix 
things. (we also use a lot of deferred binding as well).

@Ray
I am really interested in knowing why this used to work and right now it 
doesn't.
I just went ahead and changed the code inside the client bundle to cache an 
instance of OsDetection to get around the clinit.

OsDetection detection = MGWT.getOsDetection();

if (detection.isAndroidPhone()) {
  bundle = GWT.create(MGWTClientBundleBaseThemeAndroid.class);
}

if (detection.isAndroidTablet()) {
  bundle = GWT.create(MGWTClientBundleBaseThemeAndroidTablet.class);
}

This actually dropped code size of more than 29%. I think we got a lot of 
places still being affected by this change, but at this point I can go through 
the codebase and apply the workaround or even decide to bite some bullets on 
more direct deferred binding. The thing I am still wondering about what broke 
that we do see this problem now. I could offer some work time to go and build 
every version between GWT 2.5rc1 and GWT 2.4 to get a better feeling for what 
the actual commit is and if this is something we need to look further?! What do 
you think?

-Daniel











Am 12.09.2012 um 00:03 schrieb Ray Cromwell :

> I finally tracked this down, it appears Android client bundles are not
> being optimized out of the Iphone build, for example. This code:
> 
> public MGWTThemeBaseThemeStandardImpl() {
> 
>   if (MGWT.getOsDetection().isAndroidPhone()) {
>   bundle = 
> GWT.create(MGWTClientBundleBaseThemeAndroid.class);
>   }
> 
>   if (MGWT.getOsDetection().isAndroidTablet()) {
>   bundle = 
> GWT.create(MGWTClientBundleBaseThemeAndroidTablet.class);
>   }
> 
>   if (MGWT.getOsDetection().isIPhone()) {
>   if (MGWT.getOsDetection().isRetina()) {
>   bundle = 
> GWT.create(MGWTClientBundleBaseThemeRetina.class);
>   } else {
>   bundle = 
> GWT.create(MGWTClientBundleBaseThemeIPhone.class);
>   }
>   }
> 
>   if (MGWT.getOsDetection().isIPad()) {
>   if (MGWT.getOsDetection().isIPadRetina()) {
>   bundle = 
> GWT.create(MGWTClientBundleBaseThemeIPadRetina.class);
>   } else {
>   bundle = 
> GWT.create(MGWTClientBundleBaseThemeIPad.class);
>   }
> 
>   }
> ...
> }
> 
> on GWT 2.5 is optimized into:
> 
> function MGWTThemeBaseThemeStandardImpl_0(){
>  ($clinit_MGWT() , false) && (this.bundle = new
> MGWTClientBundleBaseThemeAndroid_iphone_safari_default_InlineClientBundleGenerator_0);
>  this.bundle = new
> MGWTClientBundleBaseThemeIPhone_iphone_safari_default_InlineClientBundleGenerator_0;
> }
> 
> This is essentially if(false) { android bundle}
> 
> I'm a little perplexed since the compiler has never really optimized
> stuff like (clinit(), boolean) && blah, since it would need to hoist
> the clinit() out of there which it doesn't do yet. I probably won't be
> able to fix this for 2.5, but one workaround is to inline the
> GWT.create(OsDetection) into the bundle theme and avoid calling MGWT
> (which has a non-empty clinit)
> 
> 
> On Sun, Jul 29, 2012 at 8:16 AM, Daniel Kurka  wrote:
>> I didn't have the time yet to build a test case without mgwt put here is a
>> very basic entry point.
>> 
>> Compiled with GWT 2.4 its around 30k with GWT 2.5-rc its 45k (many styles
>> not being removed):
>> 
>> I have attached an entrypoint which can be run with the latest mgwt jar in
>> the classpath:
>> https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=com.googlecode.mgwt&a=mgwt&e=jar&v=LATEST
>> 
>> 
>> 
>> Let me know if you need more input.
>> 
>> -Daniel
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 2012/7/23 Daniel Kurka 
>>> 
>>> We are not using any cell widgets (we wrote our own for mgwt, because the
>>> current ones don work for mobile).
>>> 
>>> I already have a good guess where this might be coming from. I'll try to
>>> provide a decent test ca

Re: [gwt-contrib] GWT 2.5 RC1 increases mgwt showcase by 22%

2012-09-12 Thread John A. Tamplin
On Tue, Sep 11, 2012 at 6:03 PM, Ray Cromwell wrote:

> I finally tracked this down, it appears Android client bundles are not
> being optimized out of the Iphone build, for example. This code:
>
> public MGWTThemeBaseThemeStandardImpl() {
>
> if (MGWT.getOsDetection().isAndroidPhone()) {
> bundle =
> GWT.create(MGWTClientBundleBaseThemeAndroid.class);
> }
>
> if (MGWT.getOsDetection().isAndroidTablet()) {
> bundle =
> GWT.create(MGWTClientBundleBaseThemeAndroidTablet.class);
> }
>
> if (MGWT.getOsDetection().isIPhone()) {
> if (MGWT.getOsDetection().isRetina()) {
> bundle =
> GWT.create(MGWTClientBundleBaseThemeRetina.class);
> } else {
> bundle =
> GWT.create(MGWTClientBundleBaseThemeIPhone.class);
> }
> }
>
> if (MGWT.getOsDetection().isIPad()) {
> if (MGWT.getOsDetection().isIPadRetina()) {
> bundle =
> GWT.create(MGWTClientBundleBaseThemeIPadRetina.class);
> } else {
> bundle =
> GWT.create(MGWTClientBundleBaseThemeIPad.class);
> }
>
> }
> ...
> }
>
> on GWT 2.5 is optimized into:
>
> function MGWTThemeBaseThemeStandardImpl_0(){
>   ($clinit_MGWT() , false) && (this.bundle = new
>
> MGWTClientBundleBaseThemeAndroid_iphone_safari_default_InlineClientBundleGenerator_0);
>   this.bundle = new
>
> MGWTClientBundleBaseThemeIPhone_iphone_safari_default_InlineClientBundleGenerator_0;
> }
>
> This is essentially if(false) { android bundle}
>
> I'm a little perplexed since the compiler has never really optimized
> stuff like (clinit(), boolean) && blah, since it would need to hoist
> the clinit() out of there which it doesn't do yet. I probably won't be
> able to fix this for 2.5, but one workaround is to inline the
> GWT.create(OsDetection) into the bundle theme and avoid calling MGWT
> (which has a non-empty clinit)


I haven't looked at MGWT at all, but I am confused -- if they are using
deferred binding (if they aren't, it should be no surprise that all the
mobile bundles show up since they are all in the safari permutation), why
do the ifs and rely on the compiler optimizing it away, rather than just
substituting a different MGWTClientBundleBaseTheme in the .gwt.xml rules?

-- 
John A. Tamplin

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] GWT 2.5 RC1 increases mgwt showcase by 22%

2012-09-11 Thread Ray Cromwell
I finally tracked this down, it appears Android client bundles are not
being optimized out of the Iphone build, for example. This code:

public MGWTThemeBaseThemeStandardImpl() {

if (MGWT.getOsDetection().isAndroidPhone()) {
bundle = 
GWT.create(MGWTClientBundleBaseThemeAndroid.class);
}

if (MGWT.getOsDetection().isAndroidTablet()) {
bundle = 
GWT.create(MGWTClientBundleBaseThemeAndroidTablet.class);
}

if (MGWT.getOsDetection().isIPhone()) {
if (MGWT.getOsDetection().isRetina()) {
bundle = 
GWT.create(MGWTClientBundleBaseThemeRetina.class);
} else {
bundle = 
GWT.create(MGWTClientBundleBaseThemeIPhone.class);
}
}

if (MGWT.getOsDetection().isIPad()) {
if (MGWT.getOsDetection().isIPadRetina()) {
bundle = 
GWT.create(MGWTClientBundleBaseThemeIPadRetina.class);
} else {
bundle = 
GWT.create(MGWTClientBundleBaseThemeIPad.class);
}

}
...
}

on GWT 2.5 is optimized into:

function MGWTThemeBaseThemeStandardImpl_0(){
  ($clinit_MGWT() , false) && (this.bundle = new
MGWTClientBundleBaseThemeAndroid_iphone_safari_default_InlineClientBundleGenerator_0);
  this.bundle = new
MGWTClientBundleBaseThemeIPhone_iphone_safari_default_InlineClientBundleGenerator_0;
}

This is essentially if(false) { android bundle}

I'm a little perplexed since the compiler has never really optimized
stuff like (clinit(), boolean) && blah, since it would need to hoist
the clinit() out of there which it doesn't do yet. I probably won't be
able to fix this for 2.5, but one workaround is to inline the
GWT.create(OsDetection) into the bundle theme and avoid calling MGWT
(which has a non-empty clinit)


On Sun, Jul 29, 2012 at 8:16 AM, Daniel Kurka  wrote:
> I didn't have the time yet to build a test case without mgwt put here is a
> very basic entry point.
>
> Compiled with GWT 2.4 its around 30k with GWT 2.5-rc its 45k (many styles
> not being removed):
>
> I have attached an entrypoint which can be run with the latest mgwt jar in
> the classpath:
> https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=com.googlecode.mgwt&a=mgwt&e=jar&v=LATEST
>
> 
>
> Let me know if you need more input.
>
> -Daniel
>
>
>
>
>
>
>
> 2012/7/23 Daniel Kurka 
>>
>> We are not using any cell widgets (we wrote our own for mgwt, because the
>> current ones don work for mobile).
>>
>> I already have a good guess where this might be coming from. I'll try to
>> provide a decent test case for it (without mgwt dependencies).
>>
>> -Daniel
>>
>>
>>
>> 2012/7/23 Rajeev Dayal 
>>>
>>> Daniel mentioned that somehow the CSS for the blackberry permutation is
>>> ending up in the iPhone permutation. That can't just be a Cell Widget issue.
>>>
>>>
>>> On Mon, Jul 23, 2012 at 12:24 AM, Ray Cromwell 
>>> wrote:


 Are you using any Cell widgets by any chance?

 I've seen that the Mail sample and ShowCase sample both shrunk, but the
 MobileWebApp sample increased in size. This leads me to believe it's not a
 compilation issue, but something in the user library pulling in a lot of
 extra code.

 --
 http://groups.google.com/group/Google-Web-Toolkit-Contributors
>>>
>>>
>>> --
>>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>>
>>
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: [gwt-contrib] GWT 2.5 RC1 increases mgwt showcase by 22%

2012-07-29 Thread Daniel Kurka
I didn't have the time yet to build a test case without mgwt put here is a
very basic entry point.

Compiled with GWT 2.4 its around 30k with GWT 2.5-rc its 45k (many styles
not being removed):

I have attached an entrypoint which can be run with the latest mgwt jar in
the classpath:
https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=com.googlecode.mgwt&a=mgwt&e=jar&v=LATEST



Let me know if you need more input.

-Daniel







2012/7/23 Daniel Kurka 

> We are not using any cell widgets (we wrote our own for mgwt, because the
> current ones don work for mobile).
>
> I already have a good guess where this might be coming from. I'll try to
> provide a decent test case for it (without mgwt dependencies).
>
> -Daniel
>
>
>
> 2012/7/23 Rajeev Dayal 
>
>> Daniel mentioned that somehow the CSS for the blackberry permutation is
>> ending up in the iPhone permutation. That can't just be a Cell Widget issue.
>>
>>
>> On Mon, Jul 23, 2012 at 12:24 AM, Ray Cromwell wrote:
>>
>>>
>>> Are you using any Cell widgets by any chance?
>>>
>>> I've seen that the Mail sample and ShowCase sample both shrunk, but the
>>> MobileWebApp sample increased in size. This leads me to believe it's not a
>>> compilation issue, but something in the user library pulling in a lot of
>>> extra code.
>>>
>>>  --
>>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>>
>>
>>  --
>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>
>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

MGWTEntryPoint.java
Description: Binary data


Re: [gwt-contrib] GWT 2.5 RC1 increases mgwt showcase by 22%

2012-07-23 Thread Daniel Kurka
We are not using any cell widgets (we wrote our own for mgwt, because the
current ones don work for mobile).

I already have a good guess where this might be coming from. I'll try to
provide a decent test case for it (without mgwt dependencies).

-Daniel



2012/7/23 Rajeev Dayal 

> Daniel mentioned that somehow the CSS for the blackberry permutation is
> ending up in the iPhone permutation. That can't just be a Cell Widget issue.
>
>
> On Mon, Jul 23, 2012 at 12:24 AM, Ray Cromwell wrote:
>
>>
>> Are you using any Cell widgets by any chance?
>>
>> I've seen that the Mail sample and ShowCase sample both shrunk, but the
>> MobileWebApp sample increased in size. This leads me to believe it's not a
>> compilation issue, but something in the user library pulling in a lot of
>> extra code.
>>
>>  --
>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>
>
>  --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] GWT 2.5 RC1 increases mgwt showcase by 22%

2012-07-23 Thread Rajeev Dayal
Daniel mentioned that somehow the CSS for the blackberry permutation is
ending up in the iPhone permutation. That can't just be a Cell Widget issue.

On Mon, Jul 23, 2012 at 12:24 AM, Ray Cromwell wrote:

>
> Are you using any Cell widgets by any chance?
>
> I've seen that the Mail sample and ShowCase sample both shrunk, but the
> MobileWebApp sample increased in size. This leads me to believe it's not a
> compilation issue, but something in the user library pulling in a lot of
> extra code.
>
>  --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] GWT 2.5 RC1 increases mgwt showcase by 22%

2012-07-22 Thread Ray Cromwell
Are you using any Cell widgets by any chance?

I've seen that the Mail sample and ShowCase sample both shrunk, but the
MobileWebApp sample increased in size. This leads me to believe it's not a
compilation issue, but something in the user library pulling in a lot of
extra code.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] GWT 2.5 RC1 increases mgwt showcase by 22%

2012-07-22 Thread Daniel Kurka
I am very busy this week with other priorities. I already wanted to produce a 
simple bug report on which we can easily track this down.
I`ll try to do it asap.

-Daniel


Am 18.07.2012 um 23:26 schrieb Rajeev Dayal:

> Hey Daniel,
> 
> Did you find out anything more about this? Sorry for the long delay in reply 
> - many people were on vacation after the holiday break.
> 
> I'd agree that we need to fix this for RC2/final.
> 
> Would you be able to file a bug for this so we can track it?
> 
> 
> Rajeev
> 
> On Sat, Jun 30, 2012 at 1:07 AM, Daniel Kurka  
> wrote:
> I Just took a quick look and its actually not just client bundle thats 
> affected. If someone wants to take a look here are both soyc reports: 
> https://www.dropbox.com/s/2edw73vpmde9oz4/soyc.zip
> 
> -Daniel
> 
> 
> 
> Am 30.06.2012 um 06:58 schrieb Daniel Kurka:
> 
>> I just had a few hours of spare time and went ahead and checked out the GWT 
>> release candidate together with mgwt showcase.
>> 
>> I was quite staggered to see that it increases the Javascript size by 22%. I 
>> just took a brief look at the SOYC report and it seems that it fails to 
>> remove unused CSS from different permutations (that are actually not 
>> active). Somehow CSS for the blackberry permutations ends up in the iPhone 
>> permutation
>> 
>> I am going to drill deeper into this, but to me this is quite critical.
>> 
>> -Daniel
>> 
>> 
>> 
>> 
>> 
>> 
> 
> 
> -- 
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
> 
> 
> -- 
> http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors