

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
62 messages in org.codehaus.groovy.devRe: [groovy-dev] Groovy performance: ...| From | Sent On | Attachments |
|---|---|---|
| Alex Tkachman | Feb 19, 2008 2:09 am | |
| Steven Devijver | Feb 19, 2008 2:37 am | |
| Alexandru Popescu ☀ | Feb 19, 2008 2:57 am | |
| Alex Tkachman | Feb 19, 2008 3:03 am | |
| Patric Bechtel | Feb 19, 2008 3:12 am | |
| Guillaume Laforge | Feb 19, 2008 3:25 am | |
| Guillaume Laforge | Feb 19, 2008 3:26 am | |
| Patric Bechtel | Feb 19, 2008 5:05 am | |
| Gavin Grover | Feb 19, 2008 5:51 am | |
| Steven Devijver | Feb 19, 2008 5:52 am | |
| Guillaume Laforge | Feb 19, 2008 5:54 am | |
| Tom Nichols | Feb 19, 2008 6:26 am | |
| Alex Tkachman | Feb 19, 2008 6:28 am | |
| Guillaume Laforge | Feb 19, 2008 6:35 am | |
| Tom Nichols | Feb 19, 2008 7:03 am | |
| Guillaume Laforge | Feb 19, 2008 7:38 am | |
| Chanwit Kaewkasi | Feb 19, 2008 7:52 am | |
| Charles Oliver Nutter | Feb 19, 2008 8:49 am | |
| Steven Devijver | Feb 19, 2008 10:03 am | |
| Charles Oliver Nutter | Feb 19, 2008 11:38 am | |
| Steven Devijver | Feb 19, 2008 12:11 pm | |
| Alex Tkachman | Feb 19, 2008 12:39 pm | |
| Alex Tkachman | Feb 19, 2008 12:48 pm | |
| tugwilson | Feb 19, 2008 1:36 pm | |
| Alex Tkachman | Feb 19, 2008 8:51 pm | |
| Guillaume Laforge | Feb 20, 2008 2:10 am | |
| Jochen Theodorou | Feb 20, 2008 9:46 am | |
| Martin C. Martin | Feb 20, 2008 5:25 pm | |
| Guillaume Laforge | Feb 21, 2008 1:35 am | |
| Tom Nichols | Feb 21, 2008 4:15 am | |
| Martin C. Martin | Feb 21, 2008 5:44 am | |
| Tom Nichols | Feb 21, 2008 6:22 am | |
| Smith, Jason, CTR, OASD(HA)/TMA | Feb 21, 2008 6:34 am | |
| Martin C. Martin | Feb 21, 2008 6:43 am | |
| Guillaume Laforge | Feb 21, 2008 6:48 am | |
| Guillaume Laforge | Feb 21, 2008 7:04 am | |
| Smith, Jason, CTR, OASD(HA)/TMA | Feb 21, 2008 7:18 am | |
| Charles Oliver Nutter | Feb 21, 2008 7:38 am | |
| Guillaume Laforge | Feb 21, 2008 7:42 am | |
| Martin C. Martin | Feb 21, 2008 8:36 am | |
| Martin C. Martin | Feb 21, 2008 8:48 am | |
| Pascal DeMilly | Feb 21, 2008 5:35 pm | |
| Gavin Grover | Feb 21, 2008 6:21 pm | |
| Jochen Theodorou | Feb 22, 2008 4:31 am | |
| Tom Nichols | Feb 22, 2008 4:49 am | |
| Charles Oliver Nutter | Feb 22, 2008 11:43 pm | |
| Guillaume Laforge | Feb 23, 2008 12:28 am | |
| Martin C. Martin | Feb 23, 2008 3:51 am | |
| Jochen Theodorou | Feb 23, 2008 2:49 pm | |
| Jochen Theodorou | Feb 23, 2008 2:53 pm | |
| Charles Oliver Nutter | Feb 24, 2008 2:01 am | |
| Martin C. Martin | Feb 24, 2008 3:56 am | |
| Martin C. Martin | Feb 24, 2008 4:11 am | |
| Charles Oliver Nutter | Feb 24, 2008 5:12 am | |
| Jochen Theodorou | Feb 24, 2008 3:17 pm | |
| Jochen Theodorou | Feb 24, 2008 3:31 pm | |
| Alexandru Popescu ☀ | Feb 24, 2008 3:36 pm | |
| Martin C. Martin | Feb 26, 2008 2:20 pm | |
| Martin C. Martin | Feb 26, 2008 3:15 pm | |
| Jochen Theodorou | Feb 27, 2008 2:38 am | |
| Jochen Theodorou | Feb 27, 2008 3:03 am | |
| Martin C. Martin | Mar 2, 2008 5:21 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [groovy-dev] Groovy performance: what to do | Actions... |
|---|---|---|
| From: | Guillaume Laforge (glaf...@gmail.com) | |
| Date: | Feb 21, 2008 1:35:22 am | |
| List: | org.codehaus.groovy.dev | |
On Thu, Feb 21, 2008 at 2:26 AM, Martin C. Martin <mar...@martincmartin.com> wrote:
[...] True, although it could be changed to a keyword. "static" is already taken in Java (and C and C++) to mean something else, but we could think of another keyword, e.g. "typed."
It's not a problem of annotation vs keyword. It's the concept which is not the right thing to do. It's about making the whole Groovy language faster in all possible scenarios, not just through one hack to speed-up one or two methods, which will never be as fast as Java anyway. Let's make everything at least as fast as this hack.
[...]
A few months later, and people will wonder why this is not the default behavior and be applied to all possible methods or classes. Groovy will become more and more statically typed, and for "performance sake", we'd imagine other such hacks to make Groovy less and less dynamic over time, or littered with ugly annotations.
I'm surprised you're so sure how people would use this particular feature. I work with the one language I know of that has optional typing for efficiency: Lisp. In our code base, it's not used too much, because (a) most people worry about getting the job done, and only focus on performance when it becomes a problem, and (b) it tends to clutter up the code, and people don't want to clutter up the code for no good reason. It seems a strong possibility that this would turns out the same way in Groovy. However, it's also possible things will turn out the way you say.
Nobody can forsee what tomorrow will be like, of course :-) My goal here is really to make Groovy as elegant as possible, free of hacks. In the life of the projects, Groovy's evolved by layering "good ideas of the day" over another. The result is still okay as it is today, but however good this pragmatic approach is, we have to be careful more and more about the overal elegance, homogeneity and adequacy of the language, its features, and its APIs. If we don't reflect more on elegance, people will start soon to say that Groovy is bloated, and will shy away from it, just as they already do with Java itself.
But, I'm not sure it's such a bad thing. People tend to assume things are static, and are surprised by the (possibility of) the dynamic nature. For example, people are often surprised that mylist.size() can't be compiled to mylist.length. They're even more surprised that when used in a loop, that it isn't resolved just the first time through but every time through.
This may be true to newcomers. People choose and love Groovy not because it's just like Java, but because of all the possibilities it opens. Otherwise, there's no real good reason to use Groovy if not to benefit from its power-features, thanks to its dynamicity.
[...]
Such a proposal would be a consent that we failed to make Groovy the fastest dynamic language possible. Have we really tried to make Groovy as fast as possible? Have we implemented a second generation MOP yet? No.
I'm worried that this will end up turning into a Sufficiently Smart Compiler, something that's so hard to do right that it never happens:
First of all, it's not about the compiler, but about the runtime system. So it's really two different things. Secondly, work being done by Charles Nutter or John Wilson prove that it's possible to achieve high performance, less than an order of magnitude from Java, so we know it's achievable and doable. In that case, everything would be as fast as this ugly hack which disfigures the beauty of the language by mixing different typing concepts.
[...]
Furthermore, even with such an annotation, this code path would always be slower than raw Java anyway.
True, but it would often be "fast enough." If Groovy is, say, 10 to 20 times slower than Java, and by sprinkling a few keywords or annotations around you can get it 2 times slower, that will often be good enough, and there'll be no reason to rewrite it in Java.
Again, the goal is really to have everything "fast enough", not just one corner case. It's an ambitious goal, but it's achievable.
[...]
When raw performance matter, using Java is simply the best option, and nothing we could do would make the code faster than raw Java.
Actually, that's not true. The main product of the company I work for is a search engine for air fares. It's used by some of the main travel sites in the U.S. (Orbitz.com and Kayak.com), and by most big U.S. airlines. It's very performance intensive code; whenever you do a search, it takes many seconds to find the answer, and that's one of the biggest complaints. Yet it's not written in C/C++ or any other statically typed language. It's written in Lisp.
Fine, and you know, lots of companies already use Groovy in mission-critical applications, and they just cope very well, even with older versions of Groovy which were far from what Groovy is today! As long as your SLAs are met, then that's fine if everything's in Groovy, even if some parts could be made snappier, but if it's at the cost of less readability, and more maintenance headache, it wouldn't probably worth it anyway.
Why? Because its complex algorithmic code, and it would be several times longer in a statically typed language. It would be even harder to understand. There's no single bottleneck, there are around 20 stages, and depending on the query each of them can take a significant amount of time.
Agreede.
So, I think it's a shame that Groovy can't replace Java, and I really don't see why it couldn't.
It's a bit taken out of context to just say that. I've never said Groovy can't replace Java. And I'd be happy if it would replace it, after all. What I'm saying is that it's never been a goal per se to replace Java. Groovy's always been thought as a complement, to simplify the life of developers, to play nice with the Java ecosystem. If it had not been the case, then we would have not cared that much about seamless integration, and so on, and we would have designed a brand new language from scratch, without copying the ugliness of Java (the old for loop being the most basic example of an old disgraceful C heritage).
[...] Faster than Ruby and Python is realistic without compiler hints, but it seems that significantly faster than that is relatively easy to do.
I sincerely believe that we can beat these languages, especially as the JVM evolves to support dynamic languages better, and with careful attention to the new architecture of Groovy.
I wonder: how often are the more extreme dynamic aspects of Groovy, or any dynamic language, actually used? How often is a meta object protocol (other than default ones) actually used? How often are per-instance MOPs used? How often are the changed at runtime?
In Grails, all the time! in all possible places! From top to bottom, and vice versa!
In Groovy itself, it highly depends on your usage of Groovy. If you're using Groovy just for some scripting / admin tasks, then you most propably don't care too much anyway, and in general, performance is not even a real concern. If you're using Groovy for your testing / mocking needs, all the niceties offered by Groovy's Mock support or by frameworks like Easyb, etc, then you highly depend on the dynamic aspects of Groovy. If you're using Groovy to extend existing Java application, to offer extension points, it'll depend on how you integrate it, and how friendly this integration gotta be. It could be made even better by leveraging metaclasses at key places. And if you're using Groovy as a business language, through DSL techniques, then again, you'll highly depend on the MOP.
The dynamicity of Groovy is what makes Groovy shine, what makes Groovy popular, what makes Groovy attractive, what makes it powerful.
-- Guillaume Laforge Groovy Project Manager G2One, Inc. Vice-President Technology http://www.g2one.com
--------------------------------------------------------------------- To unsubscribe from this list, please visit:







