[gwt-contrib] Lambda overhead

2016-04-15 Thread Paul Stockley
Am I right in saying that java 8 lambda's under the covers is implemented 
as an anonymous inner class? Is this also true for SAM interfaces annotated 
with JsFunction annotated interfaces?

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/369a5094-7e64-4351-b1e5-16ff5a3a2468%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Re: JsInterop is pruning non readed properties

2016-04-15 Thread Paul Stockley
So are you saying they are using just JsType=native interfaces and the 
export flag is stopping these from being pruned?


On Wednesday, April 13, 2016 at 11:55:58 AM UTC-4, Goktug Gokdogan wrote:
>
> Unfortunately, that is not true. A lot of people just need to deal with 
> native types without any need for exporting their own types to JavaScript 
> and shared libraries will start accumulating unnecessary code for all of 
> them if it is enabled by default. We have already seen this Google.
> Actually more proper solution is to have "--generateJsInteropExports 
> " and let every app choose their own subset but I don't 
> have time to implement it and took the shortcut for the 
> "--generateJsInteropExports " case.
>
> On Wed, Apr 13, 2016 at 6:16 AM, Paul Stockley  > wrote:
>
>> I agree that if you disable exports you can run into the same problem. 
>> However, I would guess most GWT users would have no reason to turn it off 
>> and in that case it would be consistent. It seems more an optimization for 
>> a use case most people won't have.
>>
>>
>> On Tuesday, April 12, 2016 at 12:51:12 PM UTC-4, Goktug Gokdogan wrote:
>>>
>>> Changing the default will not solve the SDM vs Prod problem (i.e. what 
>>> if I disabled it?). The default is sub-optimal but helps in the grand 
>>> scheme of things (There is a comment thread in the Doc discussing why the 
>>> default is chosen in the current way).
>>>
>>> SDM already doesn't export members to Global object if the flag is not 
>>> enabled. IIRC, it will also prune some unused Object instance members but 
>>> that's not aggressive for performance reasons but also not enough since you 
>>> might have a reference from Java code. I'm open to any suggestions.
>>>
>>> On Tue, Apr 12, 2016 at 9:10 AM, Paul Stockley  
>>> wrote:
>>>
 I think this flag in its current form is evil. If you forget it your 
 code will work in SDM and not in production. I would recommend one of the 
 following:

 1) Have export on by default and have a flag to turn it off
 2) or have SDM prune the non-exported classes from the code.


 On Tuesday, April 12, 2016 at 11:48:11 AM UTC-4, Ignacio Baca 
 Moreno-Torres wrote:
>
> Compiled using 2.8.0-SNAPSHOT and without -generateJsInteropExports.
> With -generateJsInteropExport works! (i.e.: Foo.bar field is not 
> pruned)
>
> On Tuesday, April 12, 2016 at 3:57:10 PM UTC+2, Ignacio Baca 
> Moreno-Torres wrote:
>>
>> This code:
>> public class Client implements EntryPoint {
>> Console log = Browser.getWindow().getConsole();
>>
>> @Override public void onModuleLoad() {
>> Foo foo = new Foo();
>> foo.bar = 666;
>> log.log(foo);
>> }
>> 
>> @JsType public static class Foo {
>> public int bar;
>> }
>> }
>>
>>
>> Generate this js:
>> function $onModuleLoad(this$static){
>>   var foo;
>>   foo = new Client$Foo;
>>   $log(this$static.log_0, foo);
>> }
>>
>>
>> I.e.: the Foo.bar var is pruned. This makes this common case (IMHO) 
>> fail silently (an empty object is sent to the server):
>>
>> Foo f = new Foo(); f.bar=666; request.send(f);
>>
>> This can be fixed using isNative=true, which might be ok, but the 
>> important thing is that this code fails silently which is really 
>> annoying. 
>> Thanks.
>>
>> -- 
 You received this message because you are subscribed to the Google 
 Groups "GWT Contributors" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to 
 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/google-web-toolkit-contributors/a8fed9ee-8137-478d-92e7-1fe5ba1a7409%40googlegroups.com
  
 
 .

 For more options, visit https://groups.google.com/d/optout.

>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Contributors" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/7ff73ac6-fbcc-47ad-8878-874b00191912%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe 

Re: [gwt-contrib] Lambda overhead

2016-04-15 Thread 'Roberto Lublinerman' via GWT Contributors
Yes, right now all lambdas are implemented as anonymous inner classes, even
the ones implementing JsFunction interfaces.

On Fri, Apr 15, 2016 at 6:11 AM, Paul Stockley  wrote:

> Am I right in saying that java 8 lambda's under the covers is implemented
> as an anonymous inner class? Is this also true for SAM interfaces annotated
> with JsFunction annotated interfaces?
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/369a5094-7e64-4351-b1e5-16ff5a3a2468%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAC7T7g%3Dmk7%3D5pDQhYdWfe8F70cfoWLE6C%2BrifMudXF_SWDosLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Lambda overhead

2016-04-15 Thread Paul Stockley
Are there plans to optimize this in the GWT2.x version in the future? 

On Friday, April 15, 2016 at 10:57:00 AM UTC-4, Roberto Lublinerman wrote:
>
> Yes, right now all lambdas are implemented as anonymous inner classes, 
> even the ones implementing JsFunction interfaces.
>
> On Fri, Apr 15, 2016 at 6:11 AM, Paul Stockley  > wrote:
>
>> Am I right in saying that java 8 lambda's under the covers is implemented 
>> as an anonymous inner class? Is this also true for SAM interfaces annotated 
>> with JsFunction annotated interfaces?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Contributors" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/369a5094-7e64-4351-b1e5-16ff5a3a2468%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/9fce9c7d-b956-4fcf-b16a-8d25ffb69e57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Lambda overhead

2016-04-15 Thread 'Roberto Lublinerman' via GWT Contributors
It should not be hard to make JsFunction lambdas more terse, but there are
no plans for GWT 2.x.

On Fri, Apr 15, 2016 at 8:25 AM, Paul Stockley  wrote:

> Are there plans to optimize this in the GWT2.x version in the future?
>
> On Friday, April 15, 2016 at 10:57:00 AM UTC-4, Roberto Lublinerman wrote:
>>
>> Yes, right now all lambdas are implemented as anonymous inner classes,
>> even the ones implementing JsFunction interfaces.
>>
>> On Fri, Apr 15, 2016 at 6:11 AM, Paul Stockley 
>> wrote:
>>
>>> Am I right in saying that java 8 lambda's under the covers is
>>> implemented as an anonymous inner class? Is this also true for SAM
>>> interfaces annotated with JsFunction annotated interfaces?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "GWT Contributors" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com
>>> .
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/369a5094-7e64-4351-b1e5-16ff5a3a2468%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/9fce9c7d-b956-4fcf-b16a-8d25ffb69e57%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAC7T7gkM79fnvDifARSkbzp-Gmf2MRHbbtLsXwO0UGYjVubWiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Re: JsInterop is pruning non readed properties

2016-04-15 Thread 'Goktug Gokdogan' via GWT Contributors
No, some "shared" libraries uses non-native JsType and passing the flag
stopping from being pruned for the majority of the apps who doesn't care.

On Fri, Apr 15, 2016 at 6:13 AM, Paul Stockley  wrote:

> So are you saying they are using just JsType=native interfaces and the
> export flag is stopping these from being pruned?
>
>
> On Wednesday, April 13, 2016 at 11:55:58 AM UTC-4, Goktug Gokdogan wrote:
>>
>> Unfortunately, that is not true. A lot of people just need to deal with
>> native types without any need for exporting their own types to JavaScript
>> and shared libraries will start accumulating unnecessary code for all of
>> them if it is enabled by default. We have already seen this Google.
>> Actually more proper solution is to have "--generateJsInteropExports
>> " and let every app choose their own subset but I don't
>> have time to implement it and took the shortcut for the
>> "--generateJsInteropExports " case.
>>
>> On Wed, Apr 13, 2016 at 6:16 AM, Paul Stockley 
>> wrote:
>>
>>> I agree that if you disable exports you can run into the same problem.
>>> However, I would guess most GWT users would have no reason to turn it off
>>> and in that case it would be consistent. It seems more an optimization for
>>> a use case most people won't have.
>>>
>>>
>>> On Tuesday, April 12, 2016 at 12:51:12 PM UTC-4, Goktug Gokdogan wrote:

 Changing the default will not solve the SDM vs Prod problem (i.e. what
 if I disabled it?). The default is sub-optimal but helps in the grand
 scheme of things (There is a comment thread in the Doc discussing why the
 default is chosen in the current way).

 SDM already doesn't export members to Global object if the flag is not
 enabled. IIRC, it will also prune some unused Object instance members but
 that's not aggressive for performance reasons but also not enough since you
 might have a reference from Java code. I'm open to any suggestions.

 On Tue, Apr 12, 2016 at 9:10 AM, Paul Stockley 
 wrote:

> I think this flag in its current form is evil. If you forget it your
> code will work in SDM and not in production. I would recommend one of the
> following:
>
> 1) Have export on by default and have a flag to turn it off
> 2) or have SDM prune the non-exported classes from the code.
>
>
> On Tuesday, April 12, 2016 at 11:48:11 AM UTC-4, Ignacio Baca
> Moreno-Torres wrote:
>>
>> Compiled using 2.8.0-SNAPSHOT and without -generateJsInteropExports.
>> With -generateJsInteropExport works! (i.e.: Foo.bar field is not
>> pruned)
>>
>> On Tuesday, April 12, 2016 at 3:57:10 PM UTC+2, Ignacio Baca
>> Moreno-Torres wrote:
>>>
>>> This code:
>>> public class Client implements EntryPoint {
>>> Console log = Browser.getWindow().getConsole();
>>>
>>> @Override public void onModuleLoad() {
>>> Foo foo = new Foo();
>>> foo.bar = 666;
>>> log.log(foo);
>>> }
>>>
>>> @JsType public static class Foo {
>>> public int bar;
>>> }
>>> }
>>>
>>>
>>> Generate this js:
>>> function $onModuleLoad(this$static){
>>>   var foo;
>>>   foo = new Client$Foo;
>>>   $log(this$static.log_0, foo);
>>> }
>>>
>>>
>>> I.e.: the Foo.bar var is pruned. This makes this common case (IMHO)
>>> fail silently (an empty object is sent to the server):
>>>
>>> Foo f = new Foo(); f.bar=666; request.send(f);
>>>
>>> This can be fixed using isNative=true, which might be ok, but the
>>> important thing is that this code fails silently which is really 
>>> annoying.
>>> Thanks.
>>>
>>> --
> You received this message because you are subscribed to the Google
> Groups "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
> google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/a8fed9ee-8137-478d-92e7-1fe5ba1a7409%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

 --
>>> You received this message because you are subscribed to the Google
>>> Groups "GWT Contributors" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com
>>> .
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/7ff73ac6-fbcc-47ad-8878-874b00191912%40googlegroups.com
>>>