You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Raviteja Lokineni <ra...@gmail.com> on 2017/02/21 21:51:53 UTC

Help with pitching Groovy and Grails

Hi Devs,

I was trying to pitch using Grails for one of our projects and the
discussions always ended up with "using reflections in JVM is slow period".
I am not knowledgeable to defend the internals of either Groovy or Grails,
need some help on this topic.

The only selling point that they identified was GORM.

I thought this might be the time to ask the developer community. I am
trying to gather some points on using Grails over a Spring boot application.

Also, can anyone help me understand how Groovy runtime optimizations are
applied on a high level and if it will affect the runtime performance.

Thanks,
-- 
*Raviteja Lokineni* | Business Intelligence Developer
TD Ameritrade

E: raviteja.lokineni@gmail.com

[image: View Raviteja Lokineni's profile on LinkedIn]
<http://in.linkedin.com/in/ravitejalokineni>

Re: Help with pitching Groovy and Grails

Posted by Graeme Rocher <gr...@gmail.com>.
The argument "using reflections in JVM is slow period" is stupid because so
much of all JVM frameworks is reflection based.

Spring used reflection for proxies, AOP, data binding, pretty much
everything.

Hibernate uses reflection to convert objects to and from the database.

The reflection part of the application is never going to be your
bottleneck. It will be your database, or message queue or whatever.

Apart from that with modern Groovy (@CompileStatic etc.) you don't have to
write everything dynamic anyway.

Cheers

On Tue, Feb 21, 2017 at 10:51 PM, Raviteja Lokineni <
raviteja.lokineni@gmail.com> wrote:

> Hi Devs,
>
> I was trying to pitch using Grails for one of our projects and the
> discussions always ended up with "using reflections in JVM is slow period".
> I am not knowledgeable to defend the internals of either Groovy or Grails,
> need some help on this topic.
>
> The only selling point that they identified was GORM.
>
> I thought this might be the time to ask the developer community. I am
> trying to gather some points on using Grails over a Spring boot application.
>
> Also, can anyone help me understand how Groovy runtime optimizations are
> applied on a high level and if it will affect the runtime performance.
>
> Thanks,
> --
> *Raviteja Lokineni* | Business Intelligence Developer
> TD Ameritrade
>
> E: raviteja.lokineni@gmail.com
>
> [image: View Raviteja Lokineni's profile on LinkedIn]
> <http://in.linkedin.com/in/ravitejalokineni>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Grails Dev Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grails-dev-discuss+unsubscribe@googlegroups.com.
> To post to this group, send email to grails-dev-discuss@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/grails-dev-discuss/CAJpE9rUp8B84w6Mz7k4_zw6c2EMh4W08oe%3Dsc_xsqfJi%
> 2BouMPw%40mail.gmail.com
> <https://groups.google.com/d/msgid/grails-dev-discuss/CAJpE9rUp8B84w6Mz7k4_zw6c2EMh4W08oe%3Dsc_xsqfJi%2BouMPw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Graeme Rocher

Re: Help with pitching Groovy and Grails

Posted by Raviteja Lokineni <ra...@gmail.com>.
+Groovy Users

I have seen Groovy grow since 1.6.x and Grails since 1.3.x and I have used
it successfully in many projects but the problem arises when convincing
organizations which are a little hesitant to use newer techs. It could also
be my inability to explain the internals correctly to people. If someone
has already done some research and can shed some light on the internals may
be I could use that to help myself.

Thanks,
Raviteja

On Tue, Feb 21, 2017 at 8:34 PM, Wilson MacGyver <wm...@gmail.com>
wrote:

> Please ask this on the regular groovy list. You will get more response.
> Both of the lists you post to are for development of groovy and grails
> itself
>
> a little preview, groovy is not slow. Hasn't been for a long time. It has
> one of the fastest json parser for example. @compileStatic often let groovy
> reach performance at same speed as java.
>
> We use groovy to process 1-2 TB of data every hour on aws.
>
> Thanks
> On Tue, Feb 21, 2017 at 4:52 PM Raviteja Lokineni <
> raviteja.lokineni@gmail.com> wrote:
>
>> Hi Devs,
>>
>> I was trying to pitch using Grails for one of our projects and the
>> discussions always ended up with "using reflections in JVM is slow period".
>> I am not knowledgeable to defend the internals of either Groovy or Grails,
>> need some help on this topic.
>>
>> The only selling point that they identified was GORM.
>>
>> I thought this might be the time to ask the developer community. I am
>> trying to gather some points on using Grails over a Spring boot application.
>>
>> Also, can anyone help me understand how Groovy runtime optimizations are
>> applied on a high level and if it will affect the runtime performance.
>>
>> Thanks,
>> --
>> *Raviteja Lokineni* | Business Intelligence Developer
>> TD Ameritrade
>>
>> E: raviteja.lokineni@gmail.com
>>
>> [image: View Raviteja Lokineni's profile on LinkedIn]
>> <http://in.linkedin.com/in/ravitejalokineni>
>>
>>


-- 
*Raviteja Lokineni* | Business Intelligence Developer
TD Ameritrade

E: raviteja.lokineni@gmail.com

[image: View Raviteja Lokineni's profile on LinkedIn]
<http://in.linkedin.com/in/ravitejalokineni>

Re: Help with pitching Groovy and Grails

Posted by Raviteja Lokineni <ra...@gmail.com>.
+Groovy Users

I have seen Groovy grow since 1.6.x and Grails since 1.3.x and I have used
it successfully in many projects but the problem arises when convincing
organizations which are a little hesitant to use newer techs. It could also
be my inability to explain the internals correctly to people. If someone
has already done some research and can shed some light on the internals may
be I could use that to help myself.

Thanks,
Raviteja

On Tue, Feb 21, 2017 at 8:34 PM, Wilson MacGyver <wm...@gmail.com>
wrote:

> Please ask this on the regular groovy list. You will get more response.
> Both of the lists you post to are for development of groovy and grails
> itself
>
> a little preview, groovy is not slow. Hasn't been for a long time. It has
> one of the fastest json parser for example. @compileStatic often let groovy
> reach performance at same speed as java.
>
> We use groovy to process 1-2 TB of data every hour on aws.
>
> Thanks
> On Tue, Feb 21, 2017 at 4:52 PM Raviteja Lokineni <
> raviteja.lokineni@gmail.com> wrote:
>
>> Hi Devs,
>>
>> I was trying to pitch using Grails for one of our projects and the
>> discussions always ended up with "using reflections in JVM is slow period".
>> I am not knowledgeable to defend the internals of either Groovy or Grails,
>> need some help on this topic.
>>
>> The only selling point that they identified was GORM.
>>
>> I thought this might be the time to ask the developer community. I am
>> trying to gather some points on using Grails over a Spring boot application.
>>
>> Also, can anyone help me understand how Groovy runtime optimizations are
>> applied on a high level and if it will affect the runtime performance.
>>
>> Thanks,
>> --
>> *Raviteja Lokineni* | Business Intelligence Developer
>> TD Ameritrade
>>
>> E: raviteja.lokineni@gmail.com
>>
>> [image: View Raviteja Lokineni's profile on LinkedIn]
>> <http://in.linkedin.com/in/ravitejalokineni>
>>
>>


-- 
*Raviteja Lokineni* | Business Intelligence Developer
TD Ameritrade

E: raviteja.lokineni@gmail.com

[image: View Raviteja Lokineni's profile on LinkedIn]
<http://in.linkedin.com/in/ravitejalokineni>

Re: Help with pitching Groovy and Grails

Posted by Wilson MacGyver <wm...@gmail.com>.
Please ask this on the regular groovy list. You will get more response.
Both of the lists you post to are for development of groovy and grails
itself

a little preview, groovy is not slow. Hasn't been for a long time. It has
one of the fastest json parser for example. @compileStatic often let groovy
reach performance at same speed as java.

We use groovy to process 1-2 TB of data every hour on aws.

Thanks
On Tue, Feb 21, 2017 at 4:52 PM Raviteja Lokineni <
raviteja.lokineni@gmail.com> wrote:

> Hi Devs,
>
> I was trying to pitch using Grails for one of our projects and the
> discussions always ended up with "using reflections in JVM is slow period".
> I am not knowledgeable to defend the internals of either Groovy or Grails,
> need some help on this topic.
>
> The only selling point that they identified was GORM.
>
> I thought this might be the time to ask the developer community. I am
> trying to gather some points on using Grails over a Spring boot application.
>
> Also, can anyone help me understand how Groovy runtime optimizations are
> applied on a high level and if it will affect the runtime performance.
>
> Thanks,
> --
> *Raviteja Lokineni* | Business Intelligence Developer
> TD Ameritrade
>
> E: raviteja.lokineni@gmail.com
>
> [image: View Raviteja Lokineni's profile on LinkedIn]
> <http://in.linkedin.com/in/ravitejalokineni>
>
>

Re: Help with pitching Groovy and Grails

Posted by Jochen Theodorou <bl...@gmx.org>.

On 24.02.2017 10:04, Remi Forax wrote:
> ----- Mail original -----
>> De: "Jochen Theodorou" <bl...@gmx.org>
>> �: dev@groovy.apache.org
>> Envoy�: Mercredi 22 F�vrier 2017 22:49:01
>> Objet: Re: Help with pitching Groovy and Grails
>
>> On 21.02.2017 22:51, Raviteja Lokineni wrote:
[...]
>>  well, of course I should
>> also mention that for a example a method call using reflection use to be
>> like factor 30 slower compared with a direct method call using Java. But
>> that is no longer true for a long time.
>
> yes, 30x was a long long time ago, i think before 1.4.2.
> The last time the reflection code was touched for speed update was during the Java 7 timeframe.

but the problem that a reflective call is a inlining barrier is still 
true, or not? Otherwise my expected performance is something like 6-10x 
slower

>> And then in Groovy we use runtime code generation to avoid Reflection and optionally you could
>> also use the indy port, which is based on invokedynamic (the same one
>> that is used for method calls for lambdas) which can be pretty fast. And
>> if that is not enough, you can still use the static compiler to be
>> around the same level as Java.
>
> Technically, invokedynamic is used from creating the lambda not for calling it,

hehe, right.

> because after creation it's more like a plain reference on an object that implement a functional interface, so it can be called like a plain old interface. There has been a prototype to use invokedynamic to call the lambda but performance was identical to an interface call so it was not integrated because invokedynamic makes the startup a little slower (like reflection does).

I see.

> In the jdk 9, invokedynamic is used when you do a concatenation with + because invokedynamic is faster that using a chain of plain old Java calls to StringBuilder.append().

that's the new and improved String handling, yes, I did hear about 
that... But I guess it is a much better example than the one I had

bye Jochen

Re: Help with pitching Groovy and Grails

Posted by Remi Forax <fo...@univ-mlv.fr>.
----- Mail original -----
> De: "Jochen Theodorou" <bl...@gmx.org>
> À: dev@groovy.apache.org
> Envoyé: Mercredi 22 Février 2017 22:49:01
> Objet: Re: Help with pitching Groovy and Grails

> On 21.02.2017 22:51, Raviteja Lokineni wrote:
>> Hi Devs,
>>
>> I was trying to pitch using Grails for one of our projects and the
>> discussions always ended up with "using reflections in JVM is slow
>> period". I am not knowledgeable to defend the internals of either Groovy
>> or Grails, need some help on this topic.
>>
>> The only selling point that they identified was GORM.
>>
>> I thought this might be the time to ask the developer community. I am
>> trying to gather some points on using Grails over a Spring boot application.
>>
>> Also, can anyone help me understand how Groovy runtime optimizations are
>> applied on a high level and if it will affect the runtime performance.
> 
> don´t forget in Grails you have a very thin Groovy layer over Java code.
> That little Groovy makes a big difference in the usage, but not in the
> performance part. And depending on what you do Groovy can be pretty fast
> (Java 10s, Groovy 15s for example). That might be related to Groovy
> actually not using Reflection where possible... well, of course I should
> also mention that for a example a method call using reflection use to be
> like factor 30 slower compared with a direct method call using Java. But
> that is no longer true for a long time. 

yes, 30x was a long long time ago, i think before 1.4.2.
The last time the reflection code was touched for speed update was during the Java 7 timeframe.

> And then in Groovy we use runtime code generation to avoid Reflection and optionally you could
> also use the indy port, which is based on invokedynamic (the same one
> that is used for method calls for lambdas) which can be pretty fast. And
> if that is not enough, you can still use the static compiler to be
> around the same level as Java.

Technically, invokedynamic is used from creating the lambda not for calling it, because after creation it's more like a plain reference on an object that implement a functional interface, so it can be called like a plain old interface. There has been a prototype to use invokedynamic to call the lambda but performance was identical to an interface call so it was not integrated because invokedynamic makes the startup a little slower (like reflection does).

In the jdk 9, invokedynamic is used when you do a concatenation with + because invokedynamic is faster that using a chain of plain old Java calls to StringBuilder.append().

> 
> bye Jochen

Rémi

Re: Help with pitching Groovy and Grails

Posted by Daniel Sun <re...@hotmail.com>.
Gotcha. Thank you, Jochen :)

Cheers,
Daniel.Sun



--
View this message in context: http://groovy.329449.n5.nabble.com/Help-with-pitching-Groovy-and-Grails-tp5738679p5738734.html
Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: Help with pitching Groovy and Grails

Posted by Jochen Theodorou <bl...@gmx.org>.
On 24.02.2017 05:17, Daniel Sun wrote:
> Hi Jochen,
>
>
>> That little Groovy makes a big difference in the usage, but not in the
> performance part.
>
>       Out of curiosity, I wonder whether Grails maintains a variant of Apache
> Groovy? What's the difference in the usage? Could you tell me some example
> about the difference?

not a different variant, just saying you should look at the full stack 
in Grails and realize what is involved. TO get a page you usually have 
some DB access, and some hibernate, then a thick layer of Spring 
services and API and on there very top is some Groovy. The database is 
more likely to become a bottleneck in this scenario.

bye Jochen


Re: Help with pitching Groovy and Grails

Posted by Daniel Sun <re...@hotmail.com>.
Hi Jochen,

      
> That little Groovy makes a big difference in the usage, but not in the
performance part. 

     Out of curiosity, I wonder whether Grails maintains a variant of Apache
Groovy? What's the difference in the usage? Could you tell me some example
about the difference?

Cheers,
Daniel.Sun



--
View this message in context: http://groovy.329449.n5.nabble.com/Help-with-pitching-Groovy-and-Grails-tp5738679p5738724.html
Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: Help with pitching Groovy and Grails

Posted by Jochen Theodorou <bl...@gmx.org>.
On 21.02.2017 22:51, Raviteja Lokineni wrote:
> Hi Devs,
>
> I was trying to pitch using Grails for one of our projects and the
> discussions always ended up with "using reflections in JVM is slow
> period". I am not knowledgeable to defend the internals of either Groovy
> or Grails, need some help on this topic.
>
> The only selling point that they identified was GORM.
>
> I thought this might be the time to ask the developer community. I am
> trying to gather some points on using Grails over a Spring boot application.
>
> Also, can anyone help me understand how Groovy runtime optimizations are
> applied on a high level and if it will affect the runtime performance.

don�t forget in Grails you have a very thin Groovy layer over Java code. 
That little Groovy makes a big difference in the usage, but not in the 
performance part. And depending on what you do Groovy can be pretty fast 
(Java 10s, Groovy 15s for example). That might be related to Groovy 
actually not using Reflection where possible... well, of course I should 
also mention that for a example a method call using reflection use to be 
like factor 30 slower compared with a direct method call using Java. But 
that is no longer true for a long time. And then in Groovy we use 
runtime code generation to avoid Reflection and optionally you could 
also use the indy port, which is based on invokedynamic (the same one 
that is used for method calls for lambdas) which can be pretty fast. And 
if that is not enough, you can still use the static compiler to be 
around the same level as Java.

bye Jochen