Another J2EE vs .NET Performance Comparison
Starting yesterday, we received a bunch of story submissions about a
performance comparison between J2EE and .Net. It didn't seem all that exciting, and we sort of ignored the story. But as usual, it appears that some people take issue with the methodology and conclusions.
Some of us are not in a position to dictate policy. Love Linux or not, some of us will have to use .Net or look for another job.
Not a good option during these bad economic times.
I mean, "...excessive exception handling"? WTF?
This only underscores the by now expected knee-jerk reaction these types of pissing contests bring. There's always some expert who can refute every single point of the whitepaper, who in turns gets dissected by someone else ad nauseaum.
In the end it's never been about benchmarks or raw speed. It's about how productive you can be writing these applications, time to "market" and total cost. It doesn't matter if J2EE is 14.3% faster than .NET or viceversa.
On a side note, I wish the 'net were never called the 'Information Superhighway.' That single analogous dubbing has spurred the acceptance of rhetoric in Congress that allows all sorts of regulation.
Slashdot: Where people pretend to be twice as smart as they really are by behaving like children.
Actually languages still continue to matter a great deal even now. While computers are getting ever faster, do you really want to offset speed gains by using languages that are inefficient for many tasks?
Don't get me wrong. I love high-level languages. Python is one of my favorite languages. However, I would not ever consider doing driver implementation or operating system work in python. Something must be said for low-level languages and their ability to relate directly to the hardware they are running on.
--Kevin
Lines of code has nothing to do with ease of use, reliability, or scalability.
;-)
This isn't some sort of a 'I can do that task in *3* lines of code, Jack!' contest..
-- I'm the root of all that's evil, but you can call me cookie..
Regardless of how you argue the testing parameters, it's pretty clear the .NET implementation won out. Even if it didn't, the Price/Performance chart makes this a pretty easy pick for most businesses.
.NET stuff is cool and people should take notice. Even the evil empire can raise the bar. And competition helps us all in the end. Lower those prices SUN and Oracle!!
You can probably get much higher performance out of the J2EE stuff at the very top end, but only by running it on the 'big iron' that most companies can't afford and even fewer actually need.
M$ has a lot of problems, but this
--- Don't be a player hater: I meta-mod ALL negative mods as Unfair.
Uhh...
Performance is an issue in enterprise applications. The difference between buying 50 servers and 100 servers matters.
(Given your user name and other info, I expected a troll. Turns out you said something reasonable. Weird.)
What you say is true on the desktop, but this comparison is between two server technologies. Desktops are fast enough these days for what we want to do with them, but servers are still often heavily overloaded. If you build a big n-tier web application, chances are it's for a commercial purpose, right? So your goal in life is to get more and more people to use that web application, so you can make more money and whatever whatever. If your application can't scale as far as you need it to, it's bad, bad. So performance is very important in situations where the size of the application user base needs to scale dependably.
I write in my journal
So is it that The Middleware Company will just claim that the winner is the one that paid them? Or is it that .NET really is the performance winner whereas J2EE wins most of the other awards?
And why is it surprising that the performance winner is the one whose entire platform, from the operating system to the SQL server to the framework, is made by a single vendor? Of course it will perform better - they're all in the same building (or complex in this case).
Schnapple
Starting yesterday, we received a bunch of story submissions about a performance comparison between J2EE and .Net. It didn't seem all that exciting, and we sort of ignored the story. But as usual, it appears that some people take issue with the methodology and conclusions.
So let me get this straight. A report comes out (that looked pretty fair to my eyes) where .Net kicks the crap out of Java, but that's not interesting. But as soon as someone puts out a (pretty silly IMO) refutation of said report it's suddenly interesting?
Yeah, yeah, I know -- it's Michael and it's Slashdot. But sheesh, come on.
Anyway, is anyone really surprised that .Net is going to be much faster than Java? It would be hard to make it slower, and if I were in charge of the .Net project, that would be one of the first issues I would address if I was making a competitor to Java.
Sometimes it's best to just let stupid people be stupid.
It's their business ethic I can't stand. .NET is the most exciting thing in distributed component programming since Objective-C and NeXT. Unlike, Microsoft has enough influnce to acutally make a new programming language part of the vernacular that programmers use.
.NET, and have been utterly amazed at the API. While C++ has about 50/50 curve (50% of the things are really easy to do, the other 50% suck) and Java raises that to about 70/30, C# and more importantly the .NET framework allow programmers to naturally write good n-tier applications. (In fact, my biggest critique on .NET is that it tends to force people to n-tier when that is not completly appropriate).
.NET is component oriented. Refliction, delegates, events, emission, cross domain calls and third party language itneroperability are all first class in .NET...
I have deployed two different production systems off of
J2EE is a horrific mess in many ways. The abstractions don't map well to real world concerns (for example, a bean represents a row, not a business object, unless your business object is a row, in which case you are probably over exposed to changes in the database), and the API's for SOAP et all are poor (unless you use Glue which rocks beyond anything else I have seen in Java).
Java's basic trade offs are part of the problem. Remember that Java was created for the purpose of running on embeded systems. This makes very simple tradeoffs (for example, optimizing for size in the bytecode instead of performance) that are not real good for large applications.
Finally, Java is object oriented.
Now, if Microsoft's business guys would just follow suit.
The original J2EE version of the Petstore application was meant as an EDUCATIONAL example for those new to J2EE. As such, it was not built with performance in mind, but rather was built with the mentality "How can we use every aspect of J2EE to implement this incredibly simple problem." No one in their right mind would use J2EE or EJBs to implement the Petstore app. It would be overkill in the extreme. And even if the J2EE version of the Petstore app was modified for performance, it's unlikely you'll be able to beat something that was built from the ground up with performance issues in mind. I'm sure this was the case with the .NET version.
If you want a good comparison of a .NET and Java version of the Petstore app, check out JPetstore which was built from the ground up with simplicity and performance as high priorities. Hopefully in the upcoming weeks we'll see some good benchmarks using this version instead of the J2EE version.
Blah Blah Blah
I've been building web applications since 1997. In nearly every app I write most of the time is spent gathering and sorting the data, not in presenting the page.
If one of my pages takes 7 seconds to come up, I can almost guarentee that the query is 6.x seconds. For that reason, I agree, language speed isn't that critical to me. What matters is: How easy is it to write/maintain? Will the language be supported? Can we hire guys that know it? Is it hard to learn?
That which does not kill me only makes me whinier
Besides that, look at the line comparison in code - the .NET version was 11,000 lines and the Java version was about 2600 lines. Clearly what happened here is that the Microsofties decided to be smart about it and write all their functions inline - not pretty but fast. Whereas the Java coders invoked class after class after class - which looks better but all the instantiations and memory allocations of classes are a big performance hit.
Why not just take an Intel chip architect and tell them to come up with something in byte code, I'll bet it'll knock the crap out of everything else!
The point is, if you created the technology, of course you're going to be able to make it faster because of your intimate knowledge. Unfortunately, I didn't create
Crowded elevator smell different to midget. -Chinese Proverb
BS stands for bullshit.
.Net. a design clearly aimed at performance and competition, MS declared their petstore is much faster than Sun's. It is a absurd and ridiculous marketing trick only MS could think out. (when they hire poople, they do ask them to think out of box by asking some stupid tricky questions, do they?)
.net one.
.Net VS two outdated version of j2ee app servers. .Net. VS linux for j2ee. (linux version of j2ee usually is the slowest one because other venders always tuned to their own hardware first, then windows, last resource is given to linux, recently IBM .Net VS using the slowest and now abandoned BMP Entity Bean for j2ee. (the new CMP Entity Bean not only faster, but also has very good cache machanism.and directly jdbc perhaps even faster if you only
a little history of pet fight.
the petstore was originally a demo application written by sun. it was a tutorial tool to demo how to use some new j2ee technologies, some best
practices and good design patterns, a 101 course for j2ee. Nothing involved to run as a real world applicaiton or optimazed for that.
then came the MS petstore for
Since it is a marketing trick targeted to nono technical managers, j2ee camp reacted by their own performance petstore, Oracle has their own version
running under oracle app server and db. I can not remember exactly the figure of the result, but it is at least 10 times faster than the
MS lost this round, they must have thought very hard for a while, now we have this new report.
The report published by TMC, the company has a web site theServerSide.com which has very high reputation in java community. MS obviously put a big money in the boss's hand and forced the report to be published. Some tricks they used now:
1. a brand new beta version of
2. using Wintel machine for
and Oracle changed their priority i think.)
3. using extensive cache for
care about the speed. )
4. MS invited to tune their application VS IBM, BEA, SUN have zero idea of this project.
5. running db and app server in same machine. (J2ee is designed for distributed computing, that is why a high overhead for EJB technology etc)
6. trying to give a impression that TSS j2ee experts joined this competation, but the fact is none of them involed. so they just fighted with a dummy made by themself.
You would have been jumping up and down with excitement, had the results been the other way around. Let's try to have at least an illusion of objectivity, OK?
When men used to be men
So you don't think that maintaining 2000 lines of code as opposed to 14000 makes any difference in the scalability, reliability or ease of use.
.Net application could be the best designed application that is has everything well abstracted and adheres tightly to the MVC model of programming, but I don't give a shit 2000 lines of code always going to better then 14000 if they both accomplish the same goal.
What's more scalable an application which is 7 times larger than it's counterpart? An application that new-to-the-project developers aren't afraid of because it's some big huge pile of code that takes countless hours to become familiar with.
How about which application is more reliable. Is the one that is 7 times the size going to be more reliable and be easier to fix bugs.
And our old friend ease of use. Let's see we have here 2 applications and one is 7 times the size as the other, which one will be the easiest and most fun for people to poke with a stick to fix all those annoying problems useability invariably comes up with.
Now of course the 14000 lines in the
Writing efficient intelligent code is the way to go, not Microsoft's write tons of shit code and hope for the best mentality towards the development process. I am talking out of my ass a bit here, but I think I make sense - or do I?
Peace
LoRider
I disagree. If I write an elegant solution that takes up 500 lines, and you write a clunky solution that takes 1000 lines, who was more productive?
Now if we come up with the same solution, but I just type faster, so i have 1000 lines done, and you have 500 lines done, who is more productive?
Performance of a developer should be measured in (features implemented - bugs found)/time * some_constant_for_how_maintainable_the_code_is
anything else, and you are lying to yourself.
I completely agree. In fact, that's why Python is my language of choice--I get more done faster, and unless I write a shitty algorithm I really don't notice a speed problem.
.Net. After all, we've been admitting for years that scripting languages are OK unless you need the extra performance, and these guys do need that extra drop. So why aren't they writing these programs in C or C++? :) Clearly it isn't the libraries or types involved, since these are almost always available to C or C++ also.
However, when it comes to this particular benchmark, it has more to do with performance on a server somewhere handling thousands of simultaneous connections. Web applications, if you will. And in this particular case, a performance difference of 10% could mean a hundred users get locked out, and responsiveness to the others will be very bad.
If you ask me, it's one of the great mysteries of the computer industry why desktop apps are written in C/C++ and web apps are written in Java, Perl, or
That's the $15 million dollar question, now isn't it? We seem to optimizing for RAD and performance, rather than just performance. Perhaps we should rethink our priorities, move scripting languages onto the desktop, and compiled languages onto the server...
--
Daniel
Soooo..... When .NET beats the pants off J2EE it's not newsworthy, but when someone questions the results it is? Surely if one is worthy of posting on /. they both should be...
Anyway, such a comparison is flawed from the start. Bench suites should be developed by independent 3rd parties, or consortiums like SPEC and NOT by vendors.
I actually don't find the results surprising. Microsoft's pet store is heavily optimized for an app server/SQL server; the standard EJB pet store should work with minimal tweaking on any EJB-compliant app server / SQL server pair.
The Raven
The Raven
People on slashdot have some really, really odd ideas about what's expensive and what's not. Here's a clue: web servers are not expensive.
I disagree. If I write an elegant solution that takes up 500 lines, and you write a clunky solution that takes 1000 lines, who was more productive?
Now if we come up with the same solution, but I just type faster, so i have 1000 lines done, and you have 500 lines done, who is more productive?
Performance of a developer should be measured in (features implemented - bugs found)/time * some_constant_for_how_maintainable_the_code_is
anything else, and you are lying to yourself.
I've said it here before and I'll likely say it again. Lines of code is an absurd measure of anything. It means nothing. A 1000 line source file can be more "elegant" and more readable than a 500 line source file and visa-versa.
And as for your typing speed comment. Anybody who thinks that even 5% of programming is typing the code in has a lot to learn. Good programming is design, documentation, testing, and refactoring. Typing in code should be a relatively small part of your job as a programmer. If it's not, most likely you're doing something wrong. If you're worried about your typing speed, you're doing something wrong. If you can tell me how many lines are in a single source file you've created without checking, you're probably doing something wrong.
It seems like these guys spent a lot of time optimizing for Java, only to see it get the smack down. Of course, there is the issue of how competent they were, but the fact remains that .net is apparently faster for this kind of thing.
Its kind of crappy that they couldn't name app servers due to 'server B's license, especially since Server B sucked so bad...
Lonely?
Find love on the internet
Why on earth would Sun put out such a horribly performing example J2EE program (Pet Store) when it knows damn well that 99% of the programmers out there will copy this program as a shining example of how to code in J2EE correctly?
For God's sake, Sun - get a clue! Give the world a better official J2EE example!
The J2EE optimization rebuttal seemed awfully complicated to expect a new Java programmer to understand.
Nevermind benchmarks optimized by experts - average shops don't have such experts. Think about the lowest common denominator. I'd rather see a benchmark of how average systems perform when designed by novices as an indicator of how good the underlying technology is. If a system has to be designed by leading experts then it is not cost effective for the average shop and I would want no part of it. Object orientation be damned - just give me something that works and does not cost an arm and a leg to extend and maintain.
if you want something stateful, you have to do it yourself. Anyone with a clue would never use EJB when all they need is a simple cache of Hashmap. The only thing that tells me is the consultants and the company that did the benchmark are either 1. idiots or 2. doing a poor job of hiding their bias. The fastest way to get blazing speed would have been to use a custom cache in resin with a simple hashmap that handles it for the webapp. Doing transaction in the database isn't the same as an application server that manages transaction in memory using Container Managed persistence.
It's just the usual marketing bs, move on, nothing to see here.
Lines of code has everything to do with ease of programmer replacment, maintenance costs, and flexibility.
This is about being able to replace your programmers easily if one of them is a pompous ass, being able to move the code base around and adapt it quickly if your OS provider is a pompous ass, and being able to keep maintenance costs down because the overal structure is smaller.
Bullshit. Organization, design and documentation of code has everything to do with ease of programmer replacement, maintenance costs, and flexibility. It's about quality, not quantity. I can have 50,000 lines of code that are split into well concieved, well documented modules that conform to accepted standards. A new programmer can come on board and maintain this code easily. I can have 3000 lines of crap code that they guy who wrote it can't maintain a year later.