Slashdot Mirror


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.

17 of 480 comments (clear)

  1. Much more interesting - a leaner JPetStore by slamb · · Score: 5, Informative

    jPetStore 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.

  2. Price/Performance page 25 says it all by Pov · · Score: 5, Insightful

    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.

    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 .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!!

    --
    --- Don't be a player hater: I meta-mod ALL negative mods as Unfair.
    1. Re:Price/Performance page 25 says it all by steve_l · · Score: 5, Insightful

      That's what comes of BEA and WebSphere pricings; if they'd used jboss or HP-app server (still a free download, I believe), app server cost becomes zero, leaving only hardware, OS and database. Move to hypersonic SQL or postgres to take oracle out the loop and you start to get economic performance. Sure, per-cpu perf may be less, but what if all those CPUs are just blade mounted PIII-8000 parts running your favourite linux distro?

      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.

  3. Re:Save your time by interiot · · Score: 5, Informative
    Actually, it's the other way around. Look at the PDF, page 40.
    • 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.
    • 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).

    This is covered right away in the rebuttal, as there seem to be some tricks played to get the discrepancy so large.
  4. Re:Performance isn't most important by Twirlip+of+the+Mists · · Score: 5, Insightful

    (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
  5. Yeah, but... by Schnapple · · Score: 5, Insightful
    Isn't The Middleware Company the same one that produced this report for SUN Microsystems and concluded that J2EE is the better of the two platforms for a variety of non-performance-related reasons? I think this report is one of the best, most coherent reports on what exactly J2EE and .NET really are and what the differences are.

    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).

  6. Re:Starting off strong - Future slashdot editor by Camel+Pilot · · Score: 5, Funny

    Unfortunately, the article contains both spelling errors, grammatical errors, and errors of style.

    Great! The the author is sufficiently qualified to become a slashdot editor.

  7. Sheesh by Reality+Master+101 · · 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.

    --
    Sometimes it's best to just let stupid people be stupid.
  8. I have no problem with microsoft's coders.. by tenchiken · · Score: 5, Insightful

    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.

    I have deployed two different production systems off of .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).

    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. .NET is component oriented. Refliction, delegates, events, emission, cross domain calls and third party language itneroperability are all first class in .NET...

    Now, if Microsoft's business guys would just follow suit.

  9. Apples and Oranges by moogy · · 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 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
  10. It's the query that matters by vanguard · · Score: 5, Insightful

    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
  11. Here are the reasons why this comparsion is BS by darthaya · · Score: 5, Insightful

    BS stands for bullshit.

    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 .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?)

    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 .net one.

    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 .Net VS two outdated version of j2ee app servers.
    2. using Wintel machine for .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
    and Oracle changed their priority i think.)
    3. using extensive cache for .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
    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.

  12. Re:Save your time by Gaijin42 · · Score: 5, Insightful

    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.

  13. Re:Performance isn't most important by fusiongyro · · Score: 5, Insightful

    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.

    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 .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.

    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

  14. You've got it reversed. by nobodyman · · Score: 5, Interesting


    Did you intentionally reverse the figures? The .NET version was 2000 lines of code, and the Java version was 14,000 lines of code

    Why not go to the source 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 .Net version used stored procedures instead of dynamic SQL statements (Sun advises dynamic sql for easier portability and because they are idiots). This time, they addressed the Java camps' gripes and J2EE still lost!

    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.

  15. They used BMP by vlad_petric · · Score: 5, Insightful
    ... and claim it's gotten them better performance ? With bean-managed persistence the developer writes the SQL code for accessing the beans; this gives a lot of flexibility, but prevents the container from doing a lot of optimizations.

    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

  16. Did no one read the other article linked to? by j3110 · · Score: 5, Informative

    I've been using J2EE now for a while, and they made some hideous performance mistakes. The #1 mistake they made was BMP. BMP, for those of you who don't know, is an object persistance model where each object manages it's own storage. It's pretty obvious that for N rows of a database that map to N objects, you will need N SQL statements. That's just wrong and bad. Not only is it the slowest way to access the database, but it requires 10x the amount of code to work with. The other two (common) choices are CMP and JDBC in session beans (others are JDO and other ADO-ish Java API's that wrap JDBC). CMP would require 1 SQL statement to retrieve N rows, and requires no SQL be written, works on all RDBMS's, and you only have to write a skeleton object. It's about a magnitude of 3 faster than CMP. Directly connecting from the Session beans(pretty much a CORPBA object) will make you write your own SQL, but will increase performance yet further(since you can use stored procedures or just do mass updates and still maintain database independance).

    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 .Net could never hold up to best price/perf. against free. JBoss may not be a speed deamon(it's not slow at all though), but if you disable debugging(on by default), use IBM JDK 1.3.0 and MySQL with innoDB, it will easily win price/performance.

    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 .Net get a foothold, but they are loosing theirs fast.

    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.

    --
    Karma Clown