Please create an account to participate in the Slashdot moderation system


Forgot your password?
Java Programming Software

Java Vs. C#: Which Performs Better In the 'Real World'? 437

Nerval's Lobster writes "Software developer Jeff Cogswell writes: 'Let's compare Java and C#, two programming languages with large numbers of ardent fans and equally virulent detractors. I'm not interested in yet another test that grindingly calculates a million digits' worth of Pi. I want to know about real-world performance: How does each language measure up when asked to dish out millions of Web pages a day? How do they compare when having to grab data from a database to construct those pages dynamically? The results were quite interesting.' Having worked as a professional C# programmer for many years, Cogswell found some long-held assumptions challenged."
This discussion has been archived. No new comments can be posted.

Java Vs. C#: Which Performs Better In the 'Real World'?

Comments Filter:
  • by Anonymous Coward on Thursday January 17, 2013 @11:17AM (#42616523)

    Windows 8 Metro doesn't use .NET.

    Cheap dig aside, you tested Java by using a C# client, so actually what you tested was C# to C# and C# to Java and concluded that C# to C# makes a lot faster connections.

    I can also save you the time and tell you Java on Windows machines is a complete dog, and on Ubuntu, it's a lot faster for the same hardware. So if you tested Java on Windows and concluded it was a dog, well yes it is, why is that?

  • by samkass ( 174571 ) on Thursday January 17, 2013 @11:30AM (#42616677) Homepage Journal

    It's also interesting to note that all tests were done on Windows. Despite him using Tomcat for Java and IIS for C# because that's the "typical" usage, he then completely does an about-face and deploys the Tomcat on Windows-- a configuration I've actually never seen and which has to give C# a bit of an advantage as the vendor-supplied OS. And yet Java still won when talking about doing anything substantial...

  • Re:Does it matter. (Score:5, Interesting)

    by i kan reed ( 749298 ) on Thursday January 17, 2013 @11:54AM (#42616993) Homepage Journal

    On the other hand, C#'s syntax has ruined java for me. Many simple tasks in java feel like they take 3 times as many steps as they need to: e.g. overloading a method with an optional bool defaulting to false requires actually writing a new overload and passing the default. To be fair, there are times when python or a functional language makes C# feel the same way, but java is just too far removed on the convenience factor for me.

  • by zifn4b ( 1040588 ) on Thursday January 17, 2013 @12:00PM (#42617047)

    Assembly is the only way to go when it comes to database oriented web apps.

    This is what I find funny about C++ zealots who hate .NET and java. Interestingly enough, Microsoft had an incubating effort to build a "framework" called Casablanca that would give C++ developers an easy way to host a web server or a RESTful web service. Part of the C++11 standard is incorporating features in languages like C# and java. It's interesting to watch the pendulum shift back and forth and the philosophical arguments being argued from ivory towers.

  • Who cares? (Score:3, Interesting)

    by characterZer0 ( 138196 ) on Thursday January 17, 2013 @12:08PM (#42617153)

    So what if there is a 25% different in performance? Hardware is cheap. Software maintenance, administration, and licensing is expensive. The most compelling reason to use Java is that I can run it on Linux. That means I can clone VMs for development and testing, copy OS installations, and ship VMs to customers and resellers without having to spend time and money on licensing and activation. It makes development, testing, and deployment easier to automate when possible and hack when necessary for the small guys that don't have volume license agreements. .NET isn't the problem. Windows is.

  • by Anonymous Coward on Thursday January 17, 2013 @12:43PM (#42617549)

    I've been doing Java development for 15+ years and most of that in web apps. Production deployments to Linux, mainframes, and Windows. Sadly, most often, the production machines are Windows. A typical argument is that it is best to have the production system similar to development (and QA, and integration testing, and user acceptance testing) system to avoid surprises as the build travels through the process.

    Concerning portability of Java across platforms, I can only recall having three issues and they are all related to file systems: paths (developer assumption), permissions, and Windows misreporting file creation time. For Java web apps, your portability issues are the same regardless of language--the browsers.

    For a true comparison of Java to C#, I can only think of one way to do it. Give four weeks of identical requirements to two teams, one of C# fanbois and one of Java fanbois. Limit them to three development weeks each, and then judge by features completed and application performance. Switch teams and complete the job. Try a larger project to flush out the architecture set up phase and then adjust your results by availability of skilled resources in the market.

  • by gshegosh ( 1587463 ) on Thursday January 17, 2013 @12:46PM (#42617585)

    Eclipse is much more user-friendly and stable than NetBeans in every iteration I have used it.

    That is interesting, my experience is completely opposite -- Netbeans is better focused on most often used functionality than on some niche stuff and extreme configurability almost noone needs, has shorter menus, less cluttered toolbars, has more intelligent and intuitive text editor (variable names guessing is so brilliant you don't notice it until you go back to other editors), has Alt-Tab that works instantly, etc. etc.

    It is also periodically reviewed for performance and tuned up, which results in amazing improvements between, say, version 6.5 and 7.2.

    Netbeans doesn't require me to get and configure additional plugins for SVN or Maven. It is much better integrated with application servers.

    etc, etc

    Have you tried Netbeans recently, or do you base your Eclipse preference on Netbeans 3.5? Because I have been forced to use Eclipse Juno for past 3 months and it is slow as hell, unintuitive, has menus that still require scrolling in full hd and still proposes arg0 as variable names...

  • by asliarun ( 636603 ) on Thursday January 17, 2013 @02:09PM (#42618479)

    No, that's not fine tuned enough. Standard practice here is to program an FPGA to do the less important work, with wire wrapped transistors doing anything that needs to perform well.

    Anything less is, well, lazy.

    From what (little) I know, that's exactly what data warehouse appliances like Netezza and Teradata do. They have custom built FPGAs to do the SQL execution significantly faster than what a CPU can do.

  • by Anonymous Coward on Thursday January 17, 2013 @02:41PM (#42618849)

    With all respect, Wt is interesting platform, but it does NOT provide the same kind of web applications as tested.

    Wt basically is sort of equivalent of terminal access to machine where the whole application process runs as single process per user. Obviously, this approach has advantages, but you would not want to implement something like '' in Wt.

    (But, speaking about C++ web frameworks:$Skylark$Tutorial$en-us.html)

  • Re:Does it matter. (Score:3, Interesting)

    by adam.voss ( 1854938 ) on Thursday January 17, 2013 @02:59PM (#42618997)
    Thankfully there is scala ( [] ) on the JVM to advance language functionality while Java is not. I would say C# and scala are more feature similar than C# is to Java anymore, especially if Macros end up coming out of the Roslyn project.
  • by gangien ( 151940 ) on Thursday January 17, 2013 @04:25PM (#42619883) Homepage

    Swing is one of the few things I've seen leave programmers speechless with frustration.

    umm what? as much as a pain as layouts can be to get things to do what you want, swing was still really well done and is incredibly flexible and versatile. I'd hardly call swing something form planet weird. And having worked with solaris/sunos some, it's really well done as well. Honestly, saying sun was from planet weird is just... weird to me :P

  • Re:Caching (Score:4, Interesting)

    by shutdown -p now ( 807394 ) on Thursday January 17, 2013 @05:08PM (#42620289) Journal

    At which point, you have two choices: use a compiled language, or use an interpreted byte code language like Java or C#.

    Neither Java nor C# are interpreted on heavy loads, they both JIT-compile, and they both have options (third-party) to compile to native code ahead of time.

    The difference in performance between C++ and Java/C# has nothing to do with bytecode, and everything with their semantics. Their object model requires a GC - that's extra overhead. Their arrays are always bounds-checked - overhead. Class instances are always allocated on the heap (except for C# structs, which are rather limited in what they can do) - overhead. And so on.

Kill Ugly Processor Architectures - Karl Lehenbauer