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.
The beast most of us have sitting on our desk these days is so fast as to make language performance not such an issue. What should be focused on to support the future of computing is a well-typed, well-structured language to allow programmers to think at a higher level of abstraction than previously. That's why I love Mac's standardization of Objective C so much -- it allows high-level control of programs. Performance only matters if it sucks.
But what do I know. I'm just looking for anonymous gay sex.
We used all java technology on www.bayoubid.com and had no problems with speed. In fact from our initial tests java was quicker than C#.
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.
The only things TMC actually proved are that they are
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.
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..
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.
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.
Quote from the article: It contains both errors, halftruths, and lies.
Unfortunately, the article contains both spelling errors, grammatical errors, and errors of style.
Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
- 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 got that backwards. Java required 14k lines of code and .NET required 2k.
this is like trying to make a race between a tortoise and a snail, only to realize that your stopwatch doesn't go over 15 minutes.
Je t'aime Stéphanie
I've heard some word (admittedly not many datapoints) that some companies are still embracing Java/J2EE, but are going for "JSPs" (hopefully a euphamism for good use of regular java objects, maybe some wrapped JDBC) instead of the fullbore EJB. In my experience, this is a very smart thing. I've had successes with using a lot of the same patterns recommended for EJB with the lighter-weight stuff, and have heard of at least 3 really collosal EJB failures.
EJB makes it easier to have physically seperate tiers, and adds enough systems-needed overhead that you'll probably need 'em...
SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
...are interesting when well researched, but basically useless to anyone who would actually have to choose between these two development environments. If you work for a company that designs applications of this kind there will be a host of more important things to consider than raw transactions per machine. The simple fact of e-commerce is that if a user is actually going to buy something at your site, you can waste tremendous processing power making them happy. If you make 2 dollars profit on a transaction and had to use 20% of the CPU on a 2Ghz processor for 40 1 second bursts (like you will if they shop using RH interchange), it's still worth it. What this benchmark argues well is that the MiddleWare product is probably worth buying if you have processor constraint problems. No amount of increased performance would warrant changing a staff of experienced Java programmers into a staff of inexperienced .net programmmers. Extra processors are just too cheap....
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
OK, first off, I don't care how many lines of comments or exception-handling routines you take out, the Microsoft solution was still 7 times smaller. If a sub at two different stores costs the same $5.00, I would definitely buy the 7-inch one over the 1-inch version for the same price; essentially, it's better no matter how you cut it (no pun intended).
.NET are irrelevant at this stage in the game, and a PHP vs. ASP review would be more relevant.
Furthermore, if Yahoo moves from C++ to PHP for the majority of their Web applications, I think that's saying something. Perhaps J2EE and
Department of Physics and Atmospheric Science, Dalhousie University, Halifax, N.S., Canada, B3H 3J5
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.
"Provided by the management for your protection."
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.
Anyone find it particularly hilarious that the Register couldn't even report the results correctly? Fine that they get anti-MS people to put in quotes, but the facts of the case (namely 14k lines of code for java v. 2k lines of code for .NET) were reported in reverse? Ugh... how these guys have a website is beyond me.
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 does correlate fairly well with programmer productivity however.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"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.
No, but LOC does impact developer productivity, and bugs. There have been a few studies showing that programmers write the same number of lines in a given time no matter what language they are using. Also, less code means less stuff to read to find bugs. I would think a 7-fold increase would have some serious reprecussions on easy of developement.
Spencer Ogden
The important question to me is does each application platform scale with commodity hardware? If so, then the more important question is which takes less time to develop and what is the availability and price of programmers for each platform? Hardware is cheap. Development time is expensive.
Benchmarks, while to completely useless, are almost completely useless.
I don't recall anyone EVER claiming that Java's execution speed kicks ass... I don't think execution speed was ever a big selling point for Java.
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
One point about the refuting article is that it talks about the merging of data and business logic layers stretches the idea of object oriented. Although the code be less reusable, merging the two layers is in fact a very intuitive way to piece an application together and doesn't overload a project with excessive classes. As well the GUI will tend to dictate what functions can be performed. If the code is just gonna be used in that one page I don't think code should be anywhere than in that page.
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?
Less is more !
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.
Are you trolling? Java server stuff isn't interpreted. Servlets and beans are compiled by the developer, while JSPs are compiled by the server (into servlets, incidentally) on demand. Some servers automatically compile all JSPs at start-up, while others wait for a request before compiling. Once all the JSPs have been compiled, Java server applications run as native, compiled Java bytecode.
I write in my journal
I thought that this type of benchmark was breaching the EULA from Microsoft. But, after reading the report I found it to be legal. Since the benchmarks put .NET into a good light, then it is ok. If the benchmark put .NET in a bad light, then the benchmark is not allowed.
Fight Spammers!
Lines of code has a little bit to do with reliability. It's a well-known fact that the more lines of code you write (called SLOCs), the more bugs you will have (notes on this here). Although more SLOCs means more bugs, density of bugs does not increase with code length (IEEE report here).
Well ... that's not *entirely* true, no.
... to name a few.
... Well, if the implementations truly were correct and fair examples, then it's a no-brainer to state that 2,000 lines of code is a helluva lot easier to maintain than 14,000, therefore making it more reliable and, possibly, scalable.
Taken as a sole measure I would agree, LOC counts must be considered strictly in context with a number of factors: proper exception handling, feature implementation, platform constraints and requirements, chosen language
But all else being equal, and given equally "correct" implementations -- that is, two sample given implementations work equally well and according to requirements -- lines of code *can* be a valid statistic. Context is the key.
Fact is, if you've got one "correct" implementation -- and I'll grant that correctness could be subject to debate in this instance -- and it takes 14,000 lines of code and you've got another that takes 2,000
LOC counts have been used in many, many code studies because they do represent a statistical measure of relative difficulty in implementation in certain respects.
Well, thats why .NET came up on top, because they probably _did_ ask MS for permission ;)
[alk]
There weren't tricks to get the descrepancy large. Sun wrote the original J2EE version. MS wrote the .net version. If Sun chose to write their code in an inefficient manner, (and you care about lines of code) then perhaps that tells you something about OTHER apps that sun writes?
Compiled Java Bytecode != Interpreted.
php,perl == Interpreted
[alk]
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
If you were to read the article, you would find this text at the bottom, "Update 2002-Oct-30 Several independent sources have now confirmed that The Middleware Company was indeed paid by Microsoft to conduct this report." Therefore, they obviously had approval from Microsoft to conduct the benchmark.
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
Since in MS's eyes, the ASP world should move to ASP.NET, how do you divorce ASP from .NET? You really can't.
As to the rest of the article, it seems as if only the hopelessly naive or people with an axe to grind will pay much attention to reports like this.
You were mistaken. Which is odd, since memory shouldn't be a problem for you
prior consent from Microsoft might be assumed, when Microsoft is paying the company to run the benchmarks in the first place.
MORTAR COMBAT!
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.
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...
Did you intentionally reverse the figures? The
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
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.
Incidentally, all this stuff was run on Windows 2000. Somebody should try it on Linux.
.NET is a lot faster
plenty of benchmarks on http://dotnetguru.org/
Yeah, I see that... from the URL.
Beware: In C++, your friends can see your privates!
Speed isn't the issue. These are two different beasties with different purposes:
.Net is a johnny-come-lately Java-alike that is designed to be a last minute substitute for the Borg JVM (I kid you not, they actually called it that). It is the platform to run Millenium on so Microsoft can finally achieve world domination. Microsoft Research didn't spend all that time and money on an "operating system for the next millenium" just to scrap it, you know.
;)
J2EE is a language/platform on which to build tools to run your business.
Microsoft's
So what do you want to do? Run your business? Or be a loyal vassal and bow to King Microsoft?
Funny thing about thousand year kingdoms by tin plate dictators: they don't last a day when the one true King of Monsters comes to town.
Shinoda: "The age of Millennium."
Io: "What does that mean?"
Shinoda: "A thousand year kingdom. It wants to create a home for itself. There is one flaw in its plan: Godzilla."
"Godzilla 2000 Millennium" (Japanese version)
There will probably be another J2EE implementation that can "beat" the .NET benchmark. However, I think there is some degree of truth to this particular one. At our .NET User Group Meeting last night, we had someone from Microsoft actually talking about this benchmark. He didn't go into much detail on the J2EE side, but said that the MiddleWare company spent 10 weeks trying to get the J2EE implementation tweaked. So either these consultants are really incompetent on the Java platform, or there really is a significant performance difference.
.NET could *ever* be faster/better/etc. than J2EE. So really, it's a religious thing and I don't think any amount of proof will convince him. And I'm sure there are certainly others out there thinking that way. Of course the other camp also believes .NET is "all that".
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
From their FAQ 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.
[alk]
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
When a report is as complete and direct as this benchmark, it is interesting to see what the jackals go after. What body parts are worth flaming/roasting? In this case, ya'll missed two notable points:
.NET versions did not leverage stored procedures on purpose (apparently the first round of benchmarks got criticized for "non-portable" use of the DB!). I'd like to see that performance, because we are talking performance and not portability.
1. Two J2EE platforms by major vendors were tested. One really sucked for air (yeah, tell me performance doesn't matter!). Who were the vendors, all you Java experts reading between the lines? Would you buy that system?
2. I understand that the
Chew on this for awhile...
Actually I couldn't care less which one you use .Net or Sun but writing efficient code is the way to go. And my response was to someone suggesting that 14000 opposed to 2000 lines of code makes no difference.
.Net was less code, but what do I know.
I am suprised though that
LoRider
Not surprised by the rigged review but are there any that show the opposite?
Perl is not interpreted and has not been for a long, long time.
Bytecode == Emulated CPU == Interpreted...
I am not merely a "consumer" or a "taxpayer". I am a Citizen of the State of Texas
Okay, this is a troll, but I'll bite.
.Net apps. Ironic.
.NET.
First off, you obviously didn't take time to read the articles. Do you have any idea what application we're talking about? It's the java "petstore" application, which specifically was not written for preformance, but for readbility and as an example for proper coding practices. MS wrote the code as an example in performance, but not as an example of good design patterns (although they claim it is).
From the article: It's quite amusing: Sun released the initial PetStore in order to show good architecture and use of design patterns but not performance, and now MS releases a PetStore that *does* have good performance but which is completely awful as far as use of good design patterns is concerned but which is supposed to show how to build
How Sun writes a tutorial has nothing to do with how Solarius or their other apps are written. If anything, it shows that Sun was actually trying to teach developers about it's product, while Microsoft was just competing for headlines with no care about proper coding practices and about teaching such practices to the developers using
Who said Freedom was Fair?
The idea was to not feed the Troll. The methodology of the whole benchmark was at the very least compromised by the active participation of one side and the complete lack of participation from the other.
.NET implementation. The other side was labeled App Server A and B since they couldn't even be bothered to get permission to publish benchmark results let alone have the App Server companies come and do some tuning.)
(MS did all the code writing and tuning for the
Even if the rest of their claims about "pain staking optimization" of the J2EE code is true they would have to optimize it separately for the two App Servers to be comparing apples to apples.
So, the original thought was to ignore it and hope it would go away. Obviously many people weren't ignoring it so it hit the "newsworthy" threshhold.
--- I wish I could hear the soundtrack to my life. That way I'd know when to duck.
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.
--
Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
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.
Apparently I'm a sucker for trolls today.
.NET which is a whole different ballpark. You're arguement about MS and their fine products makes no sense in this case. The Java programming language and environment is much more mature than .NET and is being used for many critical applications. When it comes to enterprise computing, Microsoft is a newbie and is just starting to produce something to consider, and if you would take time to really investigate the matter, you'd see that the benchmarks which suggest .NET as faster are generally flawed.
The article has nothing to do with linux. It's about JAVA vs
Who said Freedom was Fair?
It's about loving Freedom
Yes it is. Microsoft is frustrating to no end. They are like a playground bully that kicks kids down every time they try to get up. They are the class clown that twists and repeats other people's words to nullify any chance at an intelligent argument. Microsoft's behavior invokes an irrational emotion that in a natural setting results in such a bully being slaughtered in revenge.
Microsoft to many software engineers is the conceptual equivalent of industrial-age barons, factory housing, and company stores. They are corrupt, everyone suspects or knows that, but so many people are financially enslaven to Microsoft's business model that a revolt is unthinkable.
I predict that the next decades of the "information age" will mirror the aftermath of the 19th and 20th century industrial monopolies, where only intense victimization of tens of thousands of workers stirs a largely ignorant and sluggish Congress into action.
As long as the masses of people implementing IT "solutions" are so damn ignorant of how thoroughly they are being so stabbed in the back by Microsoft's breadth of lock-in and leeching contracts, we will not see freedom of information, press, academia, nor social equality in the software and internet industries.
Healthcare article at Kuro5hin
Not really. I've seen several line apps that aren't maintanable specifically becouse they rely on functionality provided by the platform, so when things change, as they quite often have in the J2EE world, keeping up to date pretty much requires scratch rewrites..
-- I'm the root of all that's evil, but you can call me cookie..
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
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).
.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.
.Net get a foothold, but they are loosing theirs fast.
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.
Karma Clown
If there is a problem with the Java version, can someone fix it?
.NET version and the code used in the J2EE version and compare them and THEN FIX IT.
Everyone here is all bothered that MS was able to work on their version, but that Sun wasn't asked to do the same for its version.
Sun can take both the code used in the
If they choose not to do so, or are UNABLE to do so, then we know which is better FOR THIS PARTICULAR TYPE OF WEB APP.
Middleware did GREATLY improve the performace of the J2EE app, but there are obviously quite a few flaws in their design (from the comments). So someone who is pissed off about this should stop wasting their time ranting about it and correct the problem, then publish the code and the benchmarks.
I do everything the voices in my head tell me to...
Bytecode == intermediate code fed to a just-in-time compiler == native code on the other end.
.Net as well. Except that the .Net runtime caches the native binary for later use, something Sun's Java VM doesn't.
It has been that way for years. You may force the VM to use interpreted code with -Xint, but why would you?
After all, the bytecode (MSIL) -> native code is EXACTLY what Microsoft does in
No, the JVM is all native (it has to be in order to run). You must be thinking of the "system classes", but they, too, are JIT-compiled.
Haha I know the answer to this question!
.NET code weights the same as 100 lines of java code
100 lines of
Live web cams
...richie - It is a good day to code.
One thing that never seems to be taken into account when it comes to scalability...
I'd rather maintain a cluster of 5 high end Sun boxes than 50+ wintel machines. Maybe most people don't view this as much of a difference but to me it sure feels like a huge savings in cost and frustration even though the initial purchase price is higher.
It's not about loving Linux. It's about loving Freedom (TM).
.NET is trifling at best, to say the least.
Realistically, though, we're talking about internet application development platforms here, not basic human rights. Being all high and mighty about not uing
Oh, one interesting fact, "the .NET version required 14,004 lines of code, while the Java version featured 2,096."
.NET had 2,096 LOC, while J2EE required 14,004 LOC. The dreambean link goes into detail about why the J2EE solution has so much more code, etc...
Hm... the PDF document, as well as this page, both say the opposite:
It looks like you were quoting something -- where did you copy that quote from? Or was it just a misquote from memory?
NGWave - Fast Sound Editor for Windows
Now of course the 14000 lines in the .Net application...
.NET solution only had 2096 lines, while the J2EE one had 14,000+ lines of code...
:p
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
NGWave - Fast Sound Editor for Windows
I read the middleware company's conclusions and was sad to see that Java lost. It looked like everything was pretty legit (certainly more so than some past endeavors like this). But then I read the article refuting it. It seems that there's a substantial amount of optimizations that were not done on the J2EE code that could have had a huge impact.
Basically when you get down to it, this is an impossible comparison to make. The architectures are different, the app servers are different, and the people writing the code are different. Trying to yield objective results out of such subjective measurements is impossible.
This sig has been temporarily disconnected or is no longer in service
That's exactly my point; perhaps I should have said negatively correlated. The 500 line solution is better- and the same thing written in certain languages tend to be more compact, and hence those languages are generally more productive. C isn't especially, C++ is often a little worse if anything, Java is more compact, Perl even more so.
Of course compactness isn't everything; APL programs are very compact, but can be totally unreadable. Still, more compact languages are usually better, upto a point.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"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.
Well, if you read the rebuttal supplied by one user then you'll see that they didn't live up to those items.
.NET side.
1. There were behavioral differences with App and Display code combined on the
2. Best practices in J2EE are now aimed at the CMP EJB's in the updated EJB spec. Those weren't used.
3. Why not a physical three-tier implmentation?
5. They used a Beta version of MS code versus unknown versions of shipping J2EE servers.
6. The code was reviewed and some major points were raised with the rebuttal.
--- I wish I could hear the soundtrack to my life. That way I'd know when to duck.
...in case you missed it in the hurry to flame me.
:)
I wasn't trying to flame, honestly. I wasn't aware of the Register's article when I posted that (nor did I see the other replies to your post). I was just curious why you (and a few others) had posted comments with the numbers swapped. Both sources that I read said something different, so again I was curious.
Now you've answered my question. No harm, no foul
NGWave - Fast Sound Editor for Windows
Yes, but experienced programmers tend to spend less time thinking and more time typing; and the thinking you do is often the same or similar for the different languages.
Also, there are some subtle issues that increased program length gives- the chances of a typo increase with program length- compact code is often easier code, for example in TCL it can take one line to create a button on the screen, whereas in Java it takes about 4- and the Java code is more obscure, and you probably have to check the API to get it right. In C you may have to discard storage after use; in Java you don't need that code- less to break, less to think about. And so on.
There's lots of little things- and it's not inevitable, it's just a correlation; that is mentioned in the literature.
Making cross language comparisons is quite difficult; you'd have to take lots of software engineers, normalise for experience and give them the same task to write in different languages, and measure how long they took and how many lines popped out.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"There's lots and lots of reason- debugging is easier, the programming language is usually closer to the problem domain if the program is shorter, typing is easier, less typos mean that successful compilation happens more quickly, often looking up the APIs in books is needed less, etc. etc.
Bottom line, everything else being equal, I'll take the shorter programming language in a heartbeat.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"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 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
The more I learn about the Internet, the more amazed I am that it works at all.
What I'd really like to know is why TMC didn't test J2EE on the same Windows OS they tested .NET on. Were they getting paid to bash two opponents at once (Linux, J2EE)? If they really wanted to test J2EE, why not JUST test J2EE?
Luke, help me take this mask off
which specifically was not written for preformance, but for readbility and as an example for proper coding practices
Are you saying that performance shouldn't be taken into consideration when deciding what "proper coding practices" are?
Or whatever properly calls the kind of FUD factory that TSS has turned out to be.
It's not so much "astroturf", which looks like nice grassgoots from a distance but turns out to be bogus when you get a close look.
It's more like fake plastic dog shit...looks unpleasant from a distance, but turns out to be phony.
When I first encountered the site, I dropped them a note asking why all their streaming video was Windows Media when there were perfectly good Java streaming video applications.It seemed awfully curious at the time for folks claiming to be part of the Java community, ,and their response was extremely...well...
So...apparently the debunker of the "benchmark" used to be Chief Archetect at TSS. I have the feeling there's an interesting story behind all this...Rikard's blog should be interesting over then next few days.-=Maggie Leber=-
I have no clue what you're talking about when referring to "The software literature" (and I don't really care frankly). I have been writing code professionally for a long time and have worked in shops with very easy to maintain code and very hard to maintain code. Documentation and the way code is broken apart and modularized is what matters. Not how much of it there is.
using the design that Microsoft proposes as best for their product (apparently they forgot to consult you, though) versus the design that Sun proposes for their product.
.NET is faster, so be it. But let's have a fair race. That's all I'm trying to point out. That's all Rickard Öberg is trying to point out in his review.
That's the problem though. These "benchmarks" are comparing different applictions designed to do different things. Sun does an app for an example of how to use J2EE technology. It wasn't designed for performance, in fact, in many cases the petstore approach is complete overkill. Sun knows that, most Java programmers know that. The petstore app has been heavily criticized for it. However, Sun's point was to show new Java programmers how the different J2EE API's work together. If some poor sap thinks that every app needs designed this way, well, they'll learn quickly otherwise I hope.
Microsoft then takes an app designed for performance and compares it to one that isn't. It's apples and oranges here folks. That's the point. The arguement made here is that when the Middleware company redid the benchmarks and the Java petstore app, that they still didn't do it properly.
If it turns out that
Who said Freedom was Fair?
While comparison with custom coded
So websphere is indeed crap performance wise..
<^>_<(ô ô)>_<^>
Java is not perfect, granted. EJB's are not always best, granted. But to say that just because EJB's aren't always a good solution therefore "J2EE blows", isn't that a bit of a leap? There are alternatives to EJB's you know. It's possible to write a full J2EE app without ever touching them.
Who said Freedom was Fair?
Me too. More than 15 years. And I have read the literature that you have no clue about. Still, there is a difference between writing code and maintaining code I suppose. Writing code is more to do with the language, maintaining code is more process oriented/limited in my experience. I have worked on several projects with very large systems (more than 10 million lines of code, more than 500 software engineers) there is very definitely a superlinear relationship between software size and maintenance difficulty. YMMV.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"Are you saying that performance shouldn't be taken into consideration when deciding what "proper coding practices" are?
.NET example. I think the argument being made here is that Sun did a 'trivial' example to show how things work. Microsoft just wrote the (to use my previous example) 'html' version of 'hello world'. Is Microsoft's approach wrong? No, that's probably how you should write such an application. The problem comes when you try to compare and benchmark the two. So Middleware tries to rewrite the Java version to optimize it and it's still bad. Conclusion? Well, the whole point of this discussion is that Rickard Öberg claims that Middleware didn't do a proper job of rewriting it.
.NET would still win. Fine. That's great. But until then, spreading inconclusive results is only spreading more FUD.
Yes. Now let me explain:
You're right that performance is important, and teaching performance techniques is important; however, there are times when that's not what you want to teach.
Example 1: Let's say we're going to teach a "hello world" application that displays "Hello World" in a web browser. Let's say I decide to do it with PHP or JSP or ASP and get the string from a database. Is that really the best way to print "Hello World?" No. Absolutely not. You'd just write the HTML and be done with it. In this case, you're trying to show how a technology works, not the best way to solve the "print 'hello world'" problem.
Example 2: For my work I recently did a simple Jakarta Struts example. It basically just queried a table from one of several databases and printed it out in HTML. It was overly complicated for just this task (did validation, internationalization, muliple views...). Now if I really wanted to put this application in a production environment, is this how I would code it? Probably not. It's overkill for this particular example. But what I was teaching was the techniques of database transactions, validatation, etc. We have other applications in development that do need these features. So what I was teaching was not "How to overly complicate your application." but "A trivial example using complicated techniques you will one day need to use." The problem with this comes when developers cannot understand when such features are needed and when they're overkill.
Back to our Java vs
I do agree with some other posters that it would be nice to see someone take the java petstore example and really do it right. Perhaps
Who said Freedom was Fair?
DreamBeans has analyzed the results and published their findings. They found a variety of biased reporting and outright lies in the original report. Their analysis is available at:
.NET version. Finally, they note that the .NET app is far from a model of application design (as MS claims).
http://dreambean.com/petstore.html
In particular, the J2EE application has not been optimized and some obvious optimizations (e.g., not using deprecated, inefficient API calls!) have been ignored. The J2EE application has been designed to do much more work storing data than the streamlined
Read their report for the juicy details (not very long).
The interesting thing is that every time a Micosoft story are shown on Slashdot several people come out and proclaim time and time again that it's all part of huge Slashdot anti-Micosoft conspiracy.
I wonder why so many people seams so interested in pointing out that non-existant conspiracy instead of the real facts.
They complain and writes a lot of off-topic posting about this proclaimed great conspiracy. Strangly it makes me come to think of advertising - by repeating someting very many times some people will start to think that what they say might be true - even though it looks more like Micosoft usual FUD tacticts. Like the time thay had a ad-person from a firm they hired switch from Mac to MS software so that she could write a positive review of the experience.
This whining loooks more like an anti-Slashdot compaign from Microsoft fanatics.
I think the problem is that you and a lot of other people should know that if Micosoft stopped being a bully and became a more well-behaved company - it would not get so mush bad press on Slashdot and other places.
Any company that use illegal business practice will have to bear their own self-inflicted burden of badwill.
Just saying it like it are.
I actually read the report, and am familiar with the Loadrunner tool they used.
.Net to show the difference.
.NET.
.NET is also designed for distributed computing.
1. They tested both version 1.0 and 1.1 of
2. They actually used Windows 2000 machines for J2EE, it's mentioned on Page 15. They stated they benchmarked both linux and Win2k, and then picked the best result. For App server A, Win2k performned better. For App server B, they were both the same(i.e. equally bad from the looks of the results).
3. I encourage you to rewrite the app using this new technology and run some benchmarks to prove your hypothesis.
4. The people running the benchmark were familiar with the J2EE world and did involve other experts to aid in tuning both J2EE and
5. According to the test lab configuration on Page 12, there were two Proliant 8500s for the database servers and another 8500 for the web/app server. I'm going to assume you meant web and app on the same server, or you just don't know how to design n-tier apps. BTW,
6. Except for the Middleware group's experts. Check their website, they are a well regarded Java training/consulting company.
I remember the same type of outrage when the Mindcraft benchmark showed IIS faster than Apache. Everybody claimed they were biased, they did it wrong, whatever.
The truth was... They were right, and some intelligent people in the Linux community looked at the bottlenecks and tried to fix them.
Gee, thanks for the references. "the literature" is so much more specific than "the software literature". I'm sure everybody knows exaclty which works you're talking about now. There can't be more than what, 5-10 books written on the subject of software development.
Any argument that says code size is relevant is inherantly flawed. Difficulty of both writing and maintaining code increases and decreases with many factors. From my personal experience, the number of lines in your source code is not one of those factors. Major factors I've found include but are not limited to the following:
1) How well the problem is defined and communicated by the people demanding the software. (HUGE deal - probably more important than anything else I've encountered regarding the success of a programming endevor)
2) The inherent complexity of said problem.
3) How well that problem is divided into managable and intuitive smaller taks by the software architect.
4) How well the system is documented outside the source
5) How well complex areas of the code are documented within the source
6) How much planning is put into development enviroments and development processes (choice of IDE's, build environments, test enviroments, source management, etc.)
There is an obvious correlation between code size and several of these factors. However, correlation is not causation and good design in some of these areas may make code larger while other may make it smaller.
I have worked with applications that have had comparatively small codebases but were extremely hard to manage due to how poorly that code was broken up and documented. The codebase I currently work with on a day to day bases is enormous. I don't know how many lines of code it surely spans thousands of lines of code. It is the easiest code I've ever worked with in terms of maintenance and extension. Did it take us longer to create than the original code? Maybe a little but the cost savings to the business in maintenance and extension will be huge.
In a sense true, but also any argument that says that code size is irrelevant is inherently flawed also. In fact as you point out:
There is an obvious correlation between code size and several of these factors.
But that's exactly my point. And if it correlates over parts of your list, then the sum of the factors correlate also. It is not a perfect correlation, but the correlation is there.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"You either didn't read my post well or you're choosing to not respond to my argument. I said, there is a correlation but it is not as simple as code size goes up = bad, code size goes down = good. Some good practices may increase code size where other ones may decrease it. You end up with a valueless measure.
Mostly the latter, your argument is missing the point, still.
Some good practices may increase code size where other ones may decrease it.
Mostly or completely irrelevant. We are talking about different languages not different designs.
Ok, based on your argument, if I'm not interested in portability I might as well exclusively use assembly language for everything. More lines of code, but since lines of code is a valueless measure that doesn't matter. Right? Wrong!
If you've done any assembly language you'll know it takes considerably longer than, say C; for the same algorithm.
Why? What is it about certain languages that makes them harder? Why do scripting languages exist? Why is a program in Java very often shorter and more reliable than the same program in C++?
Another question is why do scripting languages like Perl exist? Answer, because many times it's quicker to use than to do the same thing in C, again you end up with less lines of code for reasonably big classes of designs.
I'm not claiming that lines of code is the answer, I'm saying it is well correlated with the answer; the true answer is things like, in C++ I have to remember to free the memory, sometimes I forget, but in Java it does it for me and I can't forget, and I don't have to write extra code to do it.
But the bottom line is, two programs coded for the same algorithm (in DIFFERENT languages), have different reliabilities and different lengths. The shorter is usually more reliable, needs less coding, less debugging, less bug fixes. Design time is about the same, of course.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"