General discussion


Is "fast enough" really ok for language selection

By jslarochelle ·
My main development platform is Java (JVM) and in 2008 I started looking at alternative languages more seriously for deliverable application development. My first candidates were languages that I was using for in-house scripts: Ruby, Groovy. I was aware that these languages were much slower than Java but I really liked the dynamic aspects. I also knew that performance was improving for both these languages. However, I still feel that both languages should be faster. File processing for my in-house scripts for example is often very slow compare to what I am used too with Java.
Recently I started looking at faster alternatives (one alternative is Scala because it has performances comparable to Java). But I keep looking back at Groovy and Ruby (JRuby in my case) because the dynamic aspect of those languages is so incredibly powerful. The testing aspect is of special interest for me and being able to use things like <i>easyb</i> and the out of the box mocking capability of those languages is just incredibly atractive. I find myself thinking that a language (JRuby, Groovy) that executes millions of lines of code per seconds on a standard PC is fast enough.<br/>
Have some of you been through this kind of dilemma and how do you feel about those issues ?<br/>

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Maybe I have. .

by jslarochelle In reply to Then you answered your ow ...

But like I said, it would still be interesting to hear from people having used scripting language in commercial applications.
I agree that getting a general answer is probably not possible. However, getting a sample of real life experience would be nice.<br/>

Collapse -

Well not the tech you are looking at

by Tony Hopkinson In reply to Maybe I have. .

but we've been running IronPython from with C#.

The idea is you pass in some data and a wee script (from a range, or perhaps even user generated (given some tooling up).

Now initally I was passing in a class instance, the iron python run time, however accessed it through refelection. Worse still every access to every property on it. It reflected it again.

Needless to say, this wasn't what you would call blisteringly quick.
Given our planned uses were either for dynamic UI calculations, or a calculation service....

What I ended up doing was passing in the properties through a name=value (looked massively like a series of assignments in python for some reason ) appending teh script, and adding some interfaces to chuck out the properties and then read any differences back.

Kept the advantages we needed from Iron Python, but with wee bit more effort than orginally planned dropped, a little less flexibility, and a bit more coupling than desired. But we did get rid of the hideous cost reflection was foisting on us.

Collapse -

So you had to work on integration to get the speed you needed

by jslarochelle In reply to Well not the tech you are ...

That's interesting because your use of IronPython is what I would call a "classic application" of scripting language. Many scripting languages were created to be embeddable and work with something like eval(String). You probably had to do the extra work because the scripts are evaluated in a loop or because the scripts often have an iterative aspect to them.<br/>
This is exactly the kind of information I was looking for. Thanks Tony.<br/>

Collapse -

Java is fast?

by JackOfAllTech In reply to Is "fast enough" really o ...

I can only assume you are limiting yourself to Web applications because, compared to real, compiled languages, any interpreted ones, including Java, suffer from performance degradation.

On the other hand, modern hardware is so much faster than legacy HW, that the speed difference is less noticable.

There has always been a choice between ease of coding and speed of execution.

Collapse -

Several modern byte code interpreter languages are quite fast

by jslarochelle In reply to Java is fast?

Java is one of them but C# is also quite fast. Have a look at <a href="">The language shootout</a> for some useful comparison. There you will see that the difference between compiled C++ and a good statically typed byte code interpreted language is similar (order of magnitude) to the difference between C++ compiler version like GNU C++ and Intel C++. For example Java 1.6 server is (on average) 1.8 slower than GNU C++. On the other hand if you do the same comparison with a "pure" object oriented dynamic language like Ruby 1.9 (faster available) and Java you will see Java is closer to 10 times faster (one order of magnitude). From this you can see that Ruby is much slower relative to compiled C++ than Java (or C#). <u>But the point of the discussion is NOT finding the fastest language</u> and that's not the direction that I want this discussion to take. The question really is: "Is fast enough good enough" considering other aspect of programming languages. So, when you talk about trade-off between speed and ease of coding you are closer to the heart of the discussion.
One important aspect of the discussion is the possible pitfalls of using slower languages like Ruby or Groovy.<br/>

Related Discussions

Related Forums