Another J2EE vs .NET Performance Comparison
Posted by
michael
on Wed Oct 30, 2002 12:38 PM
from the mine-is-bigger dept.
from the mine-is-bigger dept.
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.
This discussion has been archived.
No new comments can be posted.
Another J2EE vs .NET Performance Comparison
|
Log In/Create an Account
| Top
| 533 comments
(Spill at 50!) | Index Only
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Some of us (Score:3, Insightful)
Not a good option during these bad economic times.
Performance isn't most important (Score:4, Interesting)
Re:Performance isn't most important (Score:5, Insightful)
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.
Re:Performance isn't most important (Score:4, Interesting)
It's the query that matters (Score:5, Insightful)
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?
Re:Performance isn't most important (Score:4, Interesting)
Whether or not it _actually_ matters is a whole other ball of wax, but I contend it still does. We're not a big business by any stretch of the imagination, but we need 20 servers to handle the load we do (400-600 'requests' per secondwith each request resulting in anywhere from 2 to 4 additional connections made for each request generated)
You might try rewording: In the *majority* of cases where people are selecting platforms, performance is not always the #1 issue.
That might approach the truth, but to say performance only matters if it sucks assumes you can afford the hardware to meet your demand with room to spare on the first day you go live. In enterprise applcations (lots of customers) and high load applications (less customers but each customer generates tons of load - like an ad server), performance is _exactly_ where you're going to make or break your ability to supply the demand without buying the Noah's Ark of hardware.
Re:Performance isn't most important (Score:5, Insightful)
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
Re:Save your time (Score:5, Insightful)
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.
Re:Save your time (Score:4, Informative)
I'm extremely curious, as many people have mis-quoted this figure. Where did you get this information? Is there another article that quotes this incorrectly?
The
So much for Microsoft's write tons of shit code and hope for the best mentality
Re:Save your time (Score:5, Informative)
- The Middleware Java Pet Store 2.0 implementation uses the same basic EJB-recommended
architecture as the original Java Pet Store (except fully optimized for
performance). Hence, its code count remains largely unchanged over the original at
14,004 lines of total code.
This is covered right away in the rebuttal, as there seem to be some tricks played to get the discrepancy so large.With the .NET Pet Shop 2.0 implementation, Microsoft has done some further
optimizations to reduce its overall line count, while also extending the application with
new features for distributed transactions and Web Services. The new .NET Pet Shop 2.0
contains a total of 2,096 lines of C# code (the 1.5 version had a total of 3,484 lines of
code, a 40% reduction).
You've got it reversed. (Score:5, Interesting)
Did you intentionally reverse the figures? The
Why not go to the source [middleware-company.com] and draw your own conclusion. I looked at the report and it seemed more than fair. This was a straight up "best practices vs. best practices" competition, using Sun's recommended coding standards.
It is helpful to note that this is the second such test that The Middleware Company performed. The Java folks squawked because the
In my opinion you can pin the blame squarely on EJB's. They are bloated, the environments are a royal pain to configure, and they are S-L-O-W. Sun recommends that people use them, so it's totally fair that it was used against them in this comparison.
Hate Microsoft if you want (I do), but you can't wear blinders and ignore the competition. J2EE blows. Get over it.
J2EE (Score:3, Informative)
Hmmmm. (Score:4, Insightful)
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.
Paid for by MS (Score:4, Informative)
From second article.
Reading is goood....mmmm kay (Score:5, Troll)
It's not a loss of face to admit in this particular architecture,
I don't understand why people instantly get defensive and point out conspiracies. They both kick ass, use which ever one makes you happy.
-malakai
Hot News Flash -- Java Slow! (Score:5, Funny)
Oh yeah, we are also shocked -- shocked! -- to find out that Microsoft engineers are capable of putting out a rigged demo.
These are not the benchmarks you're looking for. Move along.
Re:Hot News Flash -- Java Slow! (Score:4, Insightful)
I've done some fiddling of some rough benchmarks myself..
This isn't really a
It's not a BAD way to do it. Just as CORBA isn't really a BAD way to handle RPC calls. It's just rather large and has significant overhead.
The numbers presented actually look pretty much on par, although my local fiddling only went to the extent of using 10 clients connected to the network to beat on the machines..
Quel suprise (Score:5, Insightful)
One of the more interesting lines of commentary attached to the original article on TheServerSide was that "the community" should all band together and build a version of the Pet Shop which'd run faster in fewer LOC and on less hardware than the .Net equivalent while keeping to Sun's recommended best practices, thereby demonstrating the overarching superiority of Java and open source (or something like that.
Or, alternatively, they could choose to sit with their heads in the sand and spread fud about how Microsoft bought The Middleware Company, while waiting for the .Net train to run them over.
Sun shills, Microsoft shills, what's the difference?
One JavaBot's Reply (Score:5, Informative)
No Local Interfaces were used, so it wasn't a truely 'apples-to-apples' comparison. Local Interfaces make a huge difference (although, they claim to of not seen one in another container).
They used the latest
I'm not going to tell you J2EE is faster, but I am going to say that they did a lot of apples-to-oranges comparisons and not note them (except in the faq).
Final Conclusion (Score:4, Funny)
NOT J2EE experts
but they
ARE MS shills.
Everybody knows "benchmarks lie" as the old cliche goes. It's just funny that a chest-thumping "enterprise software" consultancy would so blatantly pitch a relatively un-scientific benchmark as a serious study.
Re:Final Conclusion (Score:4, Insightful)
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.
Much more interesting - a leaner JPetStore (Score:5, Informative)
jPetStore [ibatis.com] is worth checking out. These people decided that the J2EE pet store is way too complex, which I'm inclined to agree with. They produced, using Jakarta Struts, a Java pet store web application that is much leaner. It's comparable in size to the .NET pet store but better in several ways - there's no SQL embedded in the code, there's no HTML embedded in the database, no code was automatically generated, and it's MVC-based.
I've always thought that Enterprise Java Beans are overengineering to the extreme. It's nice to have something to back that up with now. There's no question in my mind that this JPetStore beats out both the original J2EE one and the .NET one in maintainability.
They didn't do any benchmarks - performance wasn't what they were going for - but it would be interesting to see some. I'd be inclined to believe this simpler approach would also have much better performance than J2EE.
Price/Performance page 25 says it all (Score:5, Insightful)
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
Re:Price/Performance page 25 says it all (Score:5, Insightful)
NB, after development costs, the biggest expenses in my last projects were operational costs and hardware depreciation. This review didnt look at either of those, but everyone I know is scared of IIS management, so its operational cost is probably higher.
Starting off strong (Score:3, Funny)
Unfortunately, the article contains both spelling errors, grammatical errors, and errors of style.
Re:Starting off strong - Future slashdot editor (Score:5, Funny)
Great! The the author is sufficiently qualified to become a slashdot editor.
hmm... (Score:3, Funny)
J2EE, EJBs vs "JSPs" (Score:3, Interesting)
EJB makes it easier to have physically seperate tiers, and adds enough systems-needed overhead that you'll probably need 'em...
Benchmarks for tasks with N-number of variables... (Score:4, Interesting)
Yeah, but... (Score:5, Insightful)
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).
Lies, damned lies (Score:3, Interesting)
Furthermore, if Yahoo moves from C++ to PHP for the majority of their Web applications, I think that's saying something. Perhaps J2EE and
Couldn't Resist Though, Eh? (Score:3, Funny)
It didn't seem all that exciting, and we sort of ignored the story.
Maybe we could get a bunch of people to whip up a controversy about a benchmark whitepaper comparing performance of rcp and ftp.
Regus Reporting? (Score:3, Interesting)
Sheesh (Score:5, Insightful)
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.
I have no problem with microsoft's coders.. (Score:5, Insightful)
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.
Apples and Oranges (Score:5, Insightful)
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 [ibatis.com] 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.
performance of programmers (Score:3, Interesting)
Therefore, it is much better to compare how both technologies help individual programmers as well as their teams to work faster and to produce a code with less errors (debugging time and QA resources). That would be a function of how API is structured, how concerns could be separated, how customizable code can be and will programmers tend to hardcode "business logic" riles.
Does anyone know such comparison of J2EE and .NET?
well duh (Score:4, Insightful)
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
Here are the reasons why this comparsion is BS (Score:5, Insightful)
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.
Thought it was illegal. (Score:3, Flamebait)
Not exciting? (Score:3, Insightful)
Uhhh, why is it suddenly newsworthy? (Score:3, Insightful)
Error rates (Score:3, Interesting)
Incidentally, all this stuff was run on Windows 2000. Somebody should try it on Linux.
I'm just waiting. (Score:3, Interesting)
It's even more convincing in reading the article posted in the link (the "review" that is). Basically it was bringing up how the lines of code count was not correct because J2EE could have done a better job. Bah, that's a silly argument. LOC can't just be brushed off because it really does have something to do with the cost. More lines of code isn't just for "lazy programmers", it's also a factor when you have to think about MAINTAINING that code.
However, I do buy the argument about not using the "latest and greatest" J2EE. So, I get back to my original point.. I'm just waiting for the next benchmark.
So since the author complains about the PetStore app as being such a bad design, how about coming up with a new one and then comparing those? It seems to me like, no matter what, the author of the article doesn't believe
was MS involved? (Score:4, Informative)
From their FAQ [middleware-company.com] about the benchmark..
Was Microsoft involved in this, did they fund this, where were the tests done?
Yes, Microsoft was certainly involved, as the paper describes. The Middleware Company approached Microsoft regarding performing such an experiment. Microsoft provided the lab, which was located in Seattle, funded the setup costs, and reimbursed us for expenses, including travel expenses. The Middleware Company invested several man-months in this project for which it received no compensation. The activity took much long than we expected, and at various points, we also hired independent consultants experienced in appservers A and B to tune them or provide recommendations, at our own expense. The parameters of the lab were under the control of TMC. TMC controlled the testing process. TMC stated up front that TMC would write a report about the real results, no matter what they were. These experiments are time-consuming, and require resources. Without permission and some support from Microsoft, we would not have been able to conduct the experiment. We would like to have conducted many more experiments than we did, and hope to in the future. TMC stands behind the results of the tests that were conducted.
Does the fact that Microsoft gave permission for this experiment and provided some support, invalidate the results?
That is for you to decide. TMC stands behind the results of the tests that were conducted. Should there be other such experiments to be arranged in the future, we will not be able to do them without some assistance with the lab, setup, expenses, and we would hope for more support than Microsoft provided us with for this experiment.
They used BMP (Score:5, Insightful)
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
Re:Are there any reviews that show the opposite? (Score:4, Interesting)
http://otn.oracle.com/tech/java/oc4j/pdf/9ias_n
In Oracle's study, they achieved results that were as much as 22x faster than
Did no one read the other article linked to? (Score:5, Informative)
The next thing they did is exclude JBoss, one of the most popular J2EE servers. It's open source, and easy to use. One can only conclude the intentionally left it out because
After reading that TMC had taken money from MS, the only conclusion that I could come up with is that it was rigged. No real J2EE expert would ever make those mistakes. Even free E-Books on TSS will tell you not to make mistakes like that.
Basically, this really hurts the Java community to see TMC take stabs at J2EE after all it's put into it. Either that or we are to conclude that TMC is unfit for the J2EE educational services they offer. Either way, they may have helped
Anyone that doesn't know that much about J2EE or doesn't take a look at the code will think this is like the florida recount fiasco, but it really is a legitamit claim that this version of the petstore was really written by A) a monkey, or B) a MS fundee.
The Java PetStore was never a benchmark (Score:4, Interesting)
Here's the basic story.
Once upon a time, Sun wrote a sample application, called PetStore, as a demonstration of various capabilities of the J2EE platform, and various techniques that might be helpful when writing J2EE applications. As such, it was deliberately over-engineered. A tiny shopping site doesn't need all the techniques they threw at it, it was just a context in which to deliver examples of coding pratices that might be useful in other situations. It was example code.
Speed wasn't a goal. Keeping the LOC low was counter-productive to an application which is basically an example of different coding techniques.
Microsoft saw this, and realised they had a cheap marketing opportunity. By rewriting the Pet Store in .NET, with completely different goals (speed and low LOC), they could score points just by issuing press releases. It's the marketing equivalent of saying "Hey! Our car is smaller and faster than your truck!" It's true, but meaningless.
No matter that it was an apples to oranges comparison. No matter that the Pet Store could be rewritten in Java [ibatis.com] using Open Source frameworks with about the same number of LOC by one guy in his spare time. This is marketing, not reality.
Charles Miller