Re: Permutation, code splitting and deferred property

2011-10-05 Thread Pierre Coirier
Thanks David for the follow-up.

> Could this be a result of the new PersistentUnitCache / generator caching
> stuff?
I tried having a different generator class for each value but I still
had the same issue.

> Also, Soft Permutations would cause this, so make sure those are not on.
I don't use the  tag so if I'm correct, they aren't
soft permutations.

I was able to reproduce the issue using  tag in a simple
case. I had the following code:

public class Widget1 … {}

public class Widget11 extends Widget1 {

public void oneMethod(){
GWT.runAsync(new RunAsyncCallback {
@Override
public void onSuccess() {
Widget w2 = new Widget2();
...
}
...
}
….
}

public class Widget12 extends Widget1 {

public void oneMethod(){
GWT.runAsync(new RunAsyncCallback {
@Override
public void onSuccess() {
Widget w2 = new Widget2();
...
}
...
}
….
}

and have the following configuration:
  

  

  


  

and then I just create a widget1 in my entry point:
public void onModuleLoad() {
w1 = GWT.create( Widget1.class );
...
}

When I look at the soyc report, for any permutation, GWT detects 2
split points and all the code of Widget2 is in the left-over fragment.
I'm not sure why GWT detects 2 split points because when you look at
the full code size report, only one of the 2 classes is here (which is
the expected behavior).

If it can help, you can find the code here: 
http://mvp4g.googlecode.com/svn/temp/gwt-example2.zip

Also this happens only with gwt-2.4.0 but it works fine with
gwt-2.3.0. Could it be a bug with gwt-2.4.0 (but I have to admit it is
a pretty rare case)?

I found one workaround in my case by creating an extra class that
contains the split point:

public class SplitWidget2(){

public void split(RunAsyncCallback callback){
GWT.runAsync(callback);
}

}

and then in Widget11 and Widget12:
public class Widget11 extends Widget1 {

public void oneMethod(){
newSplitWidget2().split(new RunAsyncCallback {
@Override
public void onSuccess() {
Widget w2 = new Widget2();
...
}
...
}
….
}


Thanks for your help,
Pierre

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Permutation, code splitting and deferred property

2011-10-04 Thread David Chandler
Hi Pierre,

Response from Ray Cromwell on our internal mailing list:

Could this be a result of the new PersistentUnitCache / generator caching
stuff?

Typically in GWT, people have two different Generator implementations,
so there would be a MyGeneratorFirefoxImpl and a
MyGeneratorDefaultImpl. Each would write out a differently named file
(e.g. GeneratedFileFirefox.java and GeneratedFileDefault.java).  I'm
wondering if somehow by having only a single generator and "branching"
inside of it by looking at selection variables, it's messing up some
assumptions.

Also, Soft Permutations would cause this, so make sure those are not on.

Does that help?

/dmc

On Tue, Sep 27, 2011 at 4:51 PM, Pierre Coirier  wrote:

> I added logs to my generator and it seems the generator is called when
> it is supposed to (aka only once for each permutation with the right
> value for myProperty):
> Computing all possible rebind results for
> 'com.mvp4g.client.Mvp4gModule'
> Rebinding com.mvp4g.client.Mvp4gModule
>Invoking generator com.mvp4g.util.Mvp4gGenerator
>   User.agent: 'gecko1_8, ginModule=com$mvp4g$example
> $client$FirefoxGinModule
>   2409 classes scanned in 22 ms.
>   Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_79617565
>   Generating source for
> com.mvp4g.client.Mvp4gModuleImpl_79617565
>   Mvp4g Compilation: 232ms.
> Rebinding com.mvp4g.client.Mvp4gModule
>Invoking generator com.mvp4g.util.Mvp4gGenerator
>   User.agent: 'ie6, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>   2409 classes scanned in 18 ms.
>   Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>   Generating source for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>   Mvp4g Compilation: 77ms.
> Rebinding com.mvp4g.client.Mvp4gModule
>Invoking generator com.mvp4g.util.Mvp4gGenerator
>   User.agent: 'ie8, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>   2409 classes scanned in 11 ms.
>   Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>   Mvp4g Compilation: 23ms.
> Rebinding com.mvp4g.client.Mvp4gModule
>Invoking generator com.mvp4g.util.Mvp4gGenerator
>   User.agent: 'ie9, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>   2409 classes scanned in 8 ms.
>   Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>   Mvp4g Compilation: 121ms.
> Rebinding com.mvp4g.client.Mvp4gModule
>Invoking generator com.mvp4g.util.Mvp4gGenerator
>   User.agent: 'opera, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>   2409 classes scanned in 7 ms.
>   Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>   Mvp4g Compilation: 73ms.
> Rebinding com.mvp4g.client.Mvp4gModule
>Invoking generator com.mvp4g.util.Mvp4gGenerator
>   User.agent: 'safari, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>   2409 classes scanned in 18 ms.
>   Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>   Mvp4g Compilation: 32ms.
>
> but when I look at the soyc report, I can tell that both
> implementations are used for each permutation to calculate the
> fragments for code splitting. Any idea why?
>
> Thanks,
> Pierre
>
>
> On Sep 27, 8:35 am, Pierre Coirier  wrote:
> > Thanks for pointing that out. It was a typo error, in my code I do
> > have myProperty = value2.
> >
> > If it helps, you can find the code that I'm using to reproduce the
> > error:http://mvp4g.googlecode.com/svn/temp/gwt-example.zipand the
> > soyc report:http://mvp4g.googlecode.com/svn/temp/compile-report.zip
> >
> > When you look at the report, you do see the expected deferred property
> > set:
> > Permutation 0 ('myProperty' : 'value1' , 'user.agent' : 'gecko1_8')
> >
> > but clicking on the Slip Point Report, you see the 2 implementations
> > generated are here whereas only one is expected.
> >
> > Pierre
> >
> > On Sep 27, 8:00 am, Paul Robinson  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > I don't know the answer to your question, but there is a mistake in the
> gwt.xml fragment you posted. You assign myProperty=value1 when user.agent
> equals FF and also when user.agent is not FF. You never assign myProperty =
> value2.
> >
> > > HTH
> > > Paul
> >
> > > On 27/09/11 05:37, Pierre Coirier wrote:
> >
> > > > Hi,
> >
> > > > I got an issue with deferred property and code splitting.
> >
> > > > In my GWT configuration file, I have defined the following property:
> > > > 
> > > > 
> > > >
> > > > 
> > > > 
> > > >
> > > >  
> > > >
> > > > 
> >
> > > > and I have a generator with the following code that generates one
> > > > implementation depending on 

Re: Permutation, code splitting and deferred property

2011-09-27 Thread Pierre Coirier
I added logs to my generator and it seems the generator is called when
it is supposed to (aka only once for each permutation with the right
value for myProperty):
Computing all possible rebind results for
'com.mvp4g.client.Mvp4gModule'
 Rebinding com.mvp4g.client.Mvp4gModule
Invoking generator com.mvp4g.util.Mvp4gGenerator
   User.agent: 'gecko1_8, ginModule=com$mvp4g$example
$client$FirefoxGinModule
   2409 classes scanned in 22 ms.
   Generating writer for
com.mvp4g.client.Mvp4gModuleImpl_79617565
   Generating source for
com.mvp4g.client.Mvp4gModuleImpl_79617565
   Mvp4g Compilation: 232ms.
 Rebinding com.mvp4g.client.Mvp4gModule
Invoking generator com.mvp4g.util.Mvp4gGenerator
   User.agent: 'ie6, ginModule=com$mvp4g$client
$DefaultMvp4gGinModule
   2409 classes scanned in 18 ms.
   Generating writer for
com.mvp4g.client.Mvp4gModuleImpl_A1473246115
   Generating source for
com.mvp4g.client.Mvp4gModuleImpl_A1473246115
   Mvp4g Compilation: 77ms.
 Rebinding com.mvp4g.client.Mvp4gModule
Invoking generator com.mvp4g.util.Mvp4gGenerator
   User.agent: 'ie8, ginModule=com$mvp4g$client
$DefaultMvp4gGinModule
   2409 classes scanned in 11 ms.
   Generating writer for
com.mvp4g.client.Mvp4gModuleImpl_A1473246115
   Mvp4g Compilation: 23ms.
 Rebinding com.mvp4g.client.Mvp4gModule
Invoking generator com.mvp4g.util.Mvp4gGenerator
   User.agent: 'ie9, ginModule=com$mvp4g$client
$DefaultMvp4gGinModule
   2409 classes scanned in 8 ms.
   Generating writer for
com.mvp4g.client.Mvp4gModuleImpl_A1473246115
   Mvp4g Compilation: 121ms.
 Rebinding com.mvp4g.client.Mvp4gModule
Invoking generator com.mvp4g.util.Mvp4gGenerator
   User.agent: 'opera, ginModule=com$mvp4g$client
$DefaultMvp4gGinModule
   2409 classes scanned in 7 ms.
   Generating writer for
com.mvp4g.client.Mvp4gModuleImpl_A1473246115
   Mvp4g Compilation: 73ms.
 Rebinding com.mvp4g.client.Mvp4gModule
Invoking generator com.mvp4g.util.Mvp4gGenerator
   User.agent: 'safari, ginModule=com$mvp4g$client
$DefaultMvp4gGinModule
   2409 classes scanned in 18 ms.
   Generating writer for
com.mvp4g.client.Mvp4gModuleImpl_A1473246115
   Mvp4g Compilation: 32ms.

but when I look at the soyc report, I can tell that both
implementations are used for each permutation to calculate the
fragments for code splitting. Any idea why?

Thanks,
Pierre


On Sep 27, 8:35 am, Pierre Coirier  wrote:
> Thanks for pointing that out. It was a typo error, in my code I do
> have myProperty = value2.
>
> If it helps, you can find the code that I'm using to reproduce the
> error:http://mvp4g.googlecode.com/svn/temp/gwt-example.zipand the
> soyc report:http://mvp4g.googlecode.com/svn/temp/compile-report.zip
>
> When you look at the report, you do see the expected deferred property
> set:
> Permutation 0 ('myProperty' : 'value1' , 'user.agent' : 'gecko1_8')
>
> but clicking on the Slip Point Report, you see the 2 implementations
> generated are here whereas only one is expected.
>
> Pierre
>
> On Sep 27, 8:00 am, Paul Robinson  wrote:
>
>
>
>
>
>
>
> > I don't know the answer to your question, but there is a mistake in the 
> > gwt.xml fragment you posted. You assign myProperty=value1 when user.agent 
> > equals FF and also when user.agent is not FF. You never assign myProperty = 
> > value2.
>
> > HTH
> > Paul
>
> > On 27/09/11 05:37, Pierre Coirier wrote:
>
> > > Hi,
>
> > > I got an issue with deferred property and code splitting.
>
> > > In my GWT configuration file, I have defined the following property:
> > > 
> > > 
> > >    
> > > 
> > > 
> > >    
> > >      
> > >    
> > > 
>
> > > and I have a generator with the following code that generates one
> > > implementation depending on this deferred property value:
>
> > > public String generate( TreeLogger logger, GeneratorContext context,
> > > String typeName ) throws UnableToCompleteException {
> > >      String value = propertyOracle.getSelectionProperty( logger,
> > > "myProperty" );
> > >      if("value1".equals(value)){
> > >          return generateImpl1();
> > >      } else {
> > >          return generateImpl2();
> > >      }
> > > }
>
> > > According to my settings for each browser, you can have only one
> > > value, ie for each permutation my generator should generate either
> > > Impl1 or Impl2 but not both. However in my soyc report, I noticed that
> > > for each browser/permutation, both implementations are generated.
>
> > > The issue I have is that my generator generates the same GWT.runAsync
> > > call for both implementation and since the 2 implementations are
> > > generated for each permutation 

Re: Permutation, code splitting and deferred property

2011-09-27 Thread Pierre Coirier
Thanks for pointing that out. It was a typo error, in my code I do
have myProperty = value2.

If it helps, you can find the code that I'm using to reproduce the
error: http://mvp4g.googlecode.com/svn/temp/gwt-example.zip and the
soyc report: http://mvp4g.googlecode.com/svn/temp/compile-report.zip

When you look at the report, you do see the expected deferred property
set:
Permutation 0 ('myProperty' : 'value1' , 'user.agent' : 'gecko1_8')

but clicking on the Slip Point Report, you see the 2 implementations
generated are here whereas only one is expected.

Pierre

On Sep 27, 8:00 am, Paul Robinson  wrote:
> I don't know the answer to your question, but there is a mistake in the 
> gwt.xml fragment you posted. You assign myProperty=value1 when user.agent 
> equals FF and also when user.agent is not FF. You never assign myProperty = 
> value2.
>
> HTH
> Paul
>
> On 27/09/11 05:37, Pierre Coirier wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I got an issue with deferred property and code splitting.
>
> > In my GWT configuration file, I have defined the following property:
> > 
> > 
> >    
> > 
> > 
> >    
> >      
> >    
> > 
>
> > and I have a generator with the following code that generates one
> > implementation depending on this deferred property value:
>
> > public String generate( TreeLogger logger, GeneratorContext context,
> > String typeName ) throws UnableToCompleteException {
> >      String value = propertyOracle.getSelectionProperty( logger,
> > "myProperty" );
> >      if("value1".equals(value)){
> >          return generateImpl1();
> >      } else {
> >          return generateImpl2();
> >      }
> > }
>
> > According to my settings for each browser, you can have only one
> > value, ie for each permutation my generator should generate either
> > Impl1 or Impl2 but not both. However in my soyc report, I noticed that
> > for each browser/permutation, both implementations are generated.
>
> > The issue I have is that my generator generates the same GWT.runAsync
> > call for both implementation and since the 2 implementations are
> > generated for each permutation (even if only one can be used for each
> > permutation), GWT believes there are 2 split points and since it's the
> > same code inside the 2 split points, all the code is added to the left
> > fragment code.
>
> > My question is how come my generator is called twice for each
> > permutation? Since only one value is possible for each permutation
> > shouldn't it be called only once? Am I doing something wrong in my
> > configuration which could explain why my generator is called twice?
>
> > Thanks for your help,
> > Pierre

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Permutation, code splitting and deferred property

2011-09-27 Thread Paul Robinson

I don't know the answer to your question, but there is a mistake in the gwt.xml 
fragment you posted. You assign myProperty=value1 when user.agent equals FF and 
also when user.agent is not FF. You never assign myProperty = value2.

HTH
Paul



On 27/09/11 05:37, Pierre Coirier wrote:

Hi,

I got an issue with deferred property and code splitting.

In my GWT configuration file, I have defined the following property:


   


   
 
   


and I have a generator with the following code that generates one
implementation depending on this deferred property value:

public String generate( TreeLogger logger, GeneratorContext context,
String typeName ) throws UnableToCompleteException {
 String value = propertyOracle.getSelectionProperty( logger,
"myProperty" );
 if("value1".equals(value)){
 return generateImpl1();
 } else {
 return generateImpl2();
 }
}

According to my settings for each browser, you can have only one
value, ie for each permutation my generator should generate either
Impl1 or Impl2 but not both. However in my soyc report, I noticed that
for each browser/permutation, both implementations are generated.

The issue I have is that my generator generates the same GWT.runAsync
call for both implementation and since the 2 implementations are
generated for each permutation (even if only one can be used for each
permutation), GWT believes there are 2 split points and since it's the
same code inside the 2 split points, all the code is added to the left
fragment code.

My question is how come my generator is called twice for each
permutation? Since only one value is possible for each permutation
shouldn't it be called only once? Am I doing something wrong in my
configuration which could explain why my generator is called twice?

Thanks for your help,
Pierre



--
You received this message because you are subscribed to the Google Groups "Google 
Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Permutation, code splitting and deferred property

2011-09-26 Thread Pierre Coirier
Hi,

I got an issue with deferred property and code splitting.

In my GWT configuration file, I have defined the following property:


  


  

  


and I have a generator with the following code that generates one
implementation depending on this deferred property value:

public String generate( TreeLogger logger, GeneratorContext context,
String typeName ) throws UnableToCompleteException {
String value = propertyOracle.getSelectionProperty( logger,
"myProperty" );
if("value1".equals(value)){
return generateImpl1();
} else {
return generateImpl2();
}
}

According to my settings for each browser, you can have only one
value, ie for each permutation my generator should generate either
Impl1 or Impl2 but not both. However in my soyc report, I noticed that
for each browser/permutation, both implementations are generated.

The issue I have is that my generator generates the same GWT.runAsync
call for both implementation and since the 2 implementations are
generated for each permutation (even if only one can be used for each
permutation), GWT believes there are 2 split points and since it's the
same code inside the 2 split points, all the code is added to the left
fragment code.

My question is how come my generator is called twice for each
permutation? Since only one value is possible for each permutation
shouldn't it be called only once? Am I doing something wrong in my
configuration which could explain why my generator is called twice?

Thanks for your help,
Pierre

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.