development

Earth to Sun

March 27, 2008 12:48:50.550

I love those Java guys at Sun - they're kind of cute when they try to talk smack:

Java also enjoys a 10-times performance advantage over interpreted scripting languages like JavaScript, Perl and Python, he said. "The scripting languages aren't JIT-ted yet," he said.
Scripting languages are ideal for smaller programs but Java is the choice for larger programs, he said. "As your program grows in size, the lack of strong typing basically kills your ability to handle a very large program and so you don't find the million-line Perl program," he said. One-million-line Java programs are plentiful, Click said. Strong typing refers to the capability of knowing the type of memory objects.

First, most million line programs are a mistake. The fact that Java has lots of them says nothing good about the language; the fact that it takes that much code to achieve something useful says something else entirely. Second, most of the large applications they are talking about are database bound - meaning that the raw execution speed of the code is mostly irrelevant.

Take a live example of a big app written in one of the languages these guys are throwing rocks at - Twitter. Everyone knows they had initial scaling problems, but those have gone away - and the app is still written in Ruby. Gee, why do you suppose that is? Could it be that they went and tuned the database layer, and got their load balancing situation under control? I Rather suspect that a Twitter on J2EE wouldn't exist yet, because some of the million lines of code required would still be being written.

Here's another small clue for those guys - most of the containers floating around the planet are shipped with Smalltalk code. A large proportion (possibly a majority) of the chips being built are in factories controlled in large measure by Smalltalk systems. A ton of the more profitable trading on Wall Street, by one of the most prestigious (and successful) firms there is done in Smalltalk. The firms that haven't been able to catch them? Yeah, those guys use J2EE, mores the pity.

Micro-benchmarks are pretty irrelevant, and you would think Sun's big honchos would know that. However, when you realize that J2EE is a huge pile of steaming manure weighing down the people unfortunate enough to be using it, I guess it makes sense to shout "but our arithmetic is really fast!".

Technorati Tags: , , , ,

Comments

ten times? are you kidding?

[Randal L. Schwartz] March 27, 2008 14:38:57.913

Sure, if all you show is math crunching, Java wins over Perl, because Perl prefers string wrangling to numbers.  But I've heard that Perl is on par, if not faster sometimes, than Java for most basic webapp stuff.

Database performance

[Claus] March 28, 2008 4:23:03.863

You are right on one thing: Database performance (or heck, a useful database layout) is very important.

But it also depends a bit on what has to be done with the data. If you have complex algorithms, then raw speed of the code can definitely help. Also, with old-fashioned GUIs, Java does (yet) have one advantage: Drawing directly on the video card memory instead of going through GDI or openGL (or DirectX). However, I also think those GUIs are slowly being replaced by browser applications and Seaside definitely is a forerunner there, although more people need to realize that yet.

Clau

jee5?

[chuck] March 28, 2008 7:48:10.569

So, we know what you think of J2EE by now... :D  Do you think JEE5 has improved the situation any for those poor huddled masses in Javania?  Just curious.

More Complexity...

[ James Robertson] March 28, 2008 8:08:40.348

Comment by James Robertson

If you like your steaming pile with even more baroqueness, sure :)

Be careful comparing apples and oranges

[Mark Miller] March 28, 2008 14:44:05.372

I know you've complained about this before, but so often when people are quoted about dynamic languages they always talk about Ruby and Python, which are interpreted, to the best of my knowledge. Smalltalk and Lisp are generally compiled languages. So there's a difference. Smalltalk, Lisp, Scheme, Haskell, etc. don't get talked about in these comparisons because they're considered outliers.

Even though I've heard Squeak is slower than VW, Squeak easily outperforms Ruby in one benchmark I've seen. I know you defended Ruby in the case of Twitter, but everyone I've heard from who has presumably been an RoR developer has said "Ruby is slow". In the case of Twitter I imagine they've been able to "throw sufficient hardware at it" to make it go fast enough. Another example is YouTube, which I believe was originally implemented in Python. I can remember when there were times it ran slow and glitchy. Now it's nicer, but I think they ported it to C++ and Perl after Google bought it. Not that Python couldn't have worked. It would've required a different solution.

In any case, it's not surprising to me that people would be saying that Java runs faster than Ruby and Python. I'm sure it does. Java has been approaching the speed of C for a few years now. As you were saying, what they neglect is the programmer productivity, which often gets neglected. I've discussed this with others, and it sounds like this has more to do with current accounting practices. I forget what the exact conclusion was, but programmer productivity is not expensed the same as, say, software or hardware purchases. It may be that programmer time is just considered a "cost of doing business", whereas a software/hardware purchase is considered an outlay.

Here's the thing. So long as it seems like everyone else is just as "efficient" as you are, people think "this is how it goes." They don't know any better. Even though large businesses use Smalltalk it doesn't get talked about the way Java does. Maybe it's the same reason COBOL (though I would NEVER equate the two) didn't get much publicity after a couple decades either. It just wasn't considered "exciting" anymore. Maybe Java will suffer the same fate of oblivion from the press after a couple more decades. One can hope...

[] March 29, 2008 10:24:03.367

Interesting that you talk about large programs/systems.  It is very hard to to build large systems in Smalltalk.

It lacks componentization (or at least it is very weak).

 

Everytime I get another UHE report from the field, I certainly wish for a bit more typing BTW.