Discussions

Industry news: .NET webservices outperforms J2EE webservices in new test

  1. http://www.doculabs.com/Downloads/WebServicePerformance_04-03.pdf

    While .NET beats J2EE hands down, it is interesting to see JBOSS 3.2 RC1 on RedHat 8 offer best scalability and performance among the J2EE platforms tested. The other J2EE-contenders, called appserver X and appserver Y for whatever ridicolous reasons you can imagine, also makes me wonder how much use we really have for the best-of-breed principle in an anonymous market ...

    Anyway, it'd be interesting if the test was run on the RedHat 9 kernel with threading backported from the 2.5 kernel, and using JBoss 3.2.1.

    Anyway, do anyone know what kind of performance gain the RH 9 kernel yields for java applications?

    --
    jonmartin dot solaas at mail dot link dot no
    http://solaas.minidns.net

    Threaded Messages (73)

  2. First, you can see that it was not done out of the kindness of their hearts:

    A number of vendors were contacted and invited to participate in this paid evaluation, including IBM, JBoss, Microsoft, Oracle, and others.

    Second, you can figure out who paid:

    Microsoft was the only vendor that accepted the invitation to participate.

    Third, in case you had any doubts:

    Doculabs conducted testing at a lab facility made available by Microsoft, with server, data storage, and network equipment donated by Hewlett Packard for use in the tests.

    PetStore, anyone? The good news:

    Doculabs had full control of this lab facility and certifies all results as valid and fair to all tested products.

    Well, that settles that. It was fair.

    We at least know that they used .NET 1.1. Maybe next time they'll document connection pool sizes and (if we ask nicely) even the JVM version.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  3. no, not again..[ Go to top ]

    Please Cameron,

    Everybody knows at this time that .NET outperform Java. It is only embarrassing with all this squirming excuses. I actually feel embarrassed on your behalf!

    Spear me,

    Regards
    Rolf Tollerud
  4. a modest proposal..[ Go to top ]

    Have you read Don Quixote yet?
  5. a modest proposal..[ Go to top ]

    Sure, when I was 12. Maybe when you turn 12, you can read it too. ;-)

    Regarding .NET performance, we had a thread on that, and I showed (using the .NET developer's own code) that Java was signficantly faster. I don't remember you disproving that. Until then, I consider you to be "wriggling on a pin".

    BTW - I tested with both .NET 1.0 and 1.1. FWIW - It averages between 10-15% slower than Java. Before you go and get defensive, I think .NET is plenty fast enough ... it's not the performance that is killing .NET, it's the proprietary lock-in to a product when a standard like Java exists.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  6. work is not all[ Go to top ]

    "It averages between 10-15% slower than Java"

    LOL. Very funny!

    .NET is 8 times faster, 4 times more maintainable, and 2 times more productive than "the big J2EE servers with entity beans".

    That is no marketing Cameron, but today’s reality, - despite your valiant efforts to defend your legacy Java system.

    And by the way, I think you need to reread Don Quixote and not only that one. You need more education - work is not all.

    I am only thinking of your best!

    Regards
    Rolf Tollerud
  7. work is not all[ Go to top ]

    AAAAAAAAH!!!!!

    THE FIRE ENGINE IS RED!
  8. work is not all[ Go to top ]

    Cameron,

    Sorry for the Troll, but I couldn't resist.

    Jason
  9. work is not all[ Go to top ]

    Rolf: .NET is 8 times faster, 4 times more maintainable, and 2 times more productive than "the big J2EE servers with entity beans".

    Please send me .NET code that is 8 times faster so I can benchmark it. Please include the Java code and your test results. If you would like, I will benchmark it on any/all of the following platforms:

    Windows (2000, XP, 2003)
    Solaris
    Redhat
    Redhat AS
    HP UX
    IBM AIX
    Mac OSX

    I have been using C# now for well over a year. It's just like Java, except a little worse in some areas and a little better in some areas, if you look really closely, which you have to in order to notice any difference at all. It is no more or less maintainable, unless you consider the tools that are available for Java, in which case Java comes out way ahead.

    C# is certainly not more productive than Java unless you are calling the Windows API or using COM/COM+ or integrating tightly with VB6, in which case it is 10x or 100x more productive than Java and you should use it.

    I don't dislike C# or .NET ... they are both cute products. Right now we have .NET customers using Coherence via JNBridge. If .NET ever takes off on the server, we would probably support it natively. But it's still a tiny market, and it's not moving very fast.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  10. .NET is 8 times faster, 4 times more maintainable, and 2 times more productive than "the big J2EE servers with entity beans"

    Do you know how I got to this result?

    To make something in .NET take half the time – that is my personal experience.

    When you have 4 times as much code, I assume that maintainability takes 4 times longer.

    And about the last issue (8 times faster), I come to that conclusion by the following reasoning: To make the wrong choice with EJB (for example, by follow Sun’s original recommendations) can make performance suffer more than 100 times or more. On the other hand, if you are very good, you can escape with a 50% performance loss. Therefore, making an educated guess about the skill of the average J2EE developer, I think that 8 times is a reasonable number..

    Of course, to ditch “the big app server and EJB” altogether would make the performance par with .NET. But then the average J2EE developer is “much to smart” for such solutions!;-)

    "Everything is proceeding as I have foreseen"

    Regards
    Rolf Tollerud
  11. It is a tale told by an idiot, full of sound and fury, yet signifying nothing?
  12. Cameron reads a book![ Go to top ]

    Cameron,

    I am happy to hear that you have been taking my advice and visited the place called "library". It is never too late!

    A way to make it easier for you is to substitute "evil" with ".NET", like this,

    "In life, they don't like to ponder that evil really exists. People generally want to live in peace and harmony and perhaps if they don't think about it or mention evil, perhaps it will go away?"

    Becomes:

    "In life, they don't like to ponder that .NET really exists. People generally want to live in peace and harmony and perhaps if they don't think about it or mention it, perhaps it will go away?"

    Regards
    Rolf Tollerud
    (remember there was a good side even to Macbeth!)
  13. what code..[ Go to top ]

    Cameron,

    "Regarding .NET performance, we had a thread on that, and I showed (using the .NET developer's own code) that Java was signficantly faster...

    BTW - I tested with both .NET 1.0 and 1.1. FWIW - It averages between 10-15% slower than Java
    "

    You must be dreaming, - perhaps victim of wishful thinking?

    Perhaps you would like to point me to that thread and/or the code in question?

    Regards
    Rolf Tollerud
  14. what code..[ Go to top ]

    Just search for the one discussing .NET and BigDecimal. You probably posted nonsense messages on it at least a dozen times.

    Regarding the thought of wishful thinking, and for that matter the library, I appreciate your concern for me ... honestly, I do. However, within a reasonable band, it doesn't matter how fast Java and/or .NET run. While .NET remains noticeably (10-15%) slower than modern JVMs, it will improve with time, and probably some day catch up. That is hardly something to be upset about, though ... why would it bother me that .NET became faster over time? Why would it bother anyone (besides maybe Microsoft) that JVMs became faster over time? Isn't it a little immature to be wishing for the demise of someone else? Here you are constantly bashing the JBoss guys, yet you act just like them.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  15. what code..[ Go to top ]

    Searching on “BigDecimal” give 6 hits, non-that contains any code whatsoever. I vaguely remember a case in which you have to do a public excuse after trying to expose a false bug in C# ( by not having a catch clause). I really hope that it is not that case you are referring to – when you made such an ass out of yourself. ( I am sorry to take this up, - normally when someone do an excuse – I forgive everthing)

    It is the “Big J2EE App Servers with EJB”, not Java, that really **** up things. Not only are there an average of 8 times performance loss, you also have the 80% projects failure rate.

    Anyhow, for what its worth, the performance edge with “raw” code belongs to C# until you can give some code sample that prove otherwise.

    After all, it is not such a strange thing that MS do know how to code in their own OS.

    Regards
    Rolf Tollerud
  16. what code..[ Go to top ]

    Rolf: you made such an ass out of yourself

    Your complete lack of self confidence is evidencing itself. Be careful. Next you'll be trying to show your inate mental superiority by suggesting that I read books or go to a library. ;-)

    Rolf: Anyhow, for what its worth, the performance edge with “raw” code belongs to C# until you can give some code sample that prove otherwise.

    Frankly, the CLR (not C#, which is just text) has never had an edge over modern JVMs, even on Windows. Like I said before, it wouldn't bother me if it did, but since it doesn't, I don't think the situation warrants you making "facts" up.

    If you cannot be bothered to at least find the thread, I suggest you start here: http://www.freeroller.net/page/cpurdy/20021118.

    Or maybe you did find the thread, and decided you didn't like the results, like my other friend Edgar? Did he ever respond?

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  17. Ok,I found the thread,

    First Edgar Sanchez gives this example, (http://www.theserverside.com//home/thread.jsp?thread_id=16398#65446):

    adding a cent 10 million times. Java first:

    import java.math.BigDecimal;
    import java.util.Date;

    public class DecimalAdd {
      public static void main(String[] args) {
        BigDecimal oneCent = new BigDecimal("0.01");

        Date start = new Date();
        BigDecimal total = new BigDecimal(0);
        for (int i = 0; i < 10000000; i++)
          total = total.add(oneCent);
        Date finish = new Date();

        System.out.println("Total: " + total);
        System.out.println("Time: " + (finish.getTime() - start.getTime()));
      }
    }

    And C#:

    using System;

    public class DecimalAdd
    {
      public static void Main()
      {
        decimal oneCent = 0.01m;

        DateTime start = DateTime.Now;
        decimal total = 0m;
        for (int i = 0; i < 10000000; i++)
          total += oneCent;
        DateTime finish = DateTime.Now;

        Console.WriteLine("Total: " + total);
        Console.WriteLine("Time: " + (finish - start));
      }
    }

    <Edgar>In this very machine, Java takes from 15.3 to 22.4 seconds, C# takes from 1.2 to 1.4 seconds, that doesn't look like 10 to 20% faster to me...</Edgar>

    In my machine: C# 1.7 seconds, Java 10.6 seconds.

    In answer to that, you change the test so that the C# example gets an overflow. And you say,
    (http://www.theserverside.com//home/thread.jsp?thread_id=16398#65501):

    <Cameron>Application has generated an exception that could not be handled.
    Process id=0x3dc (988), Thread id=0x1b4 (436).

    Is that a UAE or a GPF? Unfortunately, with .NET being so quick, I wasn't able to get a good timing for how fast it blew up. Please advise"
    </Cameron>

    Then for some time in the thread people glee over the supposed C# bug until, Adi Oltean from Microsoft informs that it is an unhandled exception (http://www.theserverside.com//home/thread.jsp?thread_id=16398#65673)

    Thereafter you come with your apology, (http://www.theserverside.com//home/thread.jsp?thread_id=16398#65707):

    <Cameron>My apologies. That makes sense now, since the console application didn't perform any exception handling</Cameron>

    The result of all this fuss is that now have everybody forgot about the performance issue! (Normal behavior in dishonest discussions)

    Then in your Weblog (http://www.freeroller.net/page/cpurdy/20021118), not in the thread! - you claim that after some settings with -Xms and -Xmx Java now suddenly performs 30% better! So C# 1.7 seconds, Java 10.6 seconds is now history..

    This reminds me of Oracle when they claimed that their "PetShop" with some minor tweaks suddenly was 560 times faster..

    Cameron, I do not know what you are doing - but it is certainly entertaining!

    Regards
    Rolf Tollerud
  18. When you eventually learn .NET, you will find that the decimal type is not the same as Java's BigDecimal (aka BloatedDecimal). Perhaps you would like to compare the .NET decimal type to the C int type, just to be fair? Both can handle integer values up to 2 billion, but C is much faster.

    Please post equivalent code and the performance difference.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  19. Did you miss this part? From the thread:

    C:\temp\dotnet>ManyPeople.exe
    Average=49999
    Total time: 00:00:08.0615920
    Average=49999
    Total time: 00:00:08.1417072
    Average=49999
    Total time: 00:00:08.1116640
    ...
    Average=49999
    Total time: 00:00:08.0415632
    Average=49999
    Total time: 00:00:08.0415632
    Average=49999
    Total time: 00:00:08.1417072

    -- Java --

    Average: 49999
    Average time: 7911
    Average: 49999
    Average time: 6169
    Average: 49999
    ...
    Average: 49999
    Average time: 5118
    Average: 49999
    Average time: 4937
    Average: 49999
    Average time: 4977
    Average: 49999
    Average time: 4557

    BTW - that is on Sun's HotSpot, which is why successive runs get faster and faster. NOTE THAT EVEN THE FIRST PROBABLY-INTERPRETED RUN WAS STILL FASTER THAN .NET!!!
  20. I do not understand what you are talking about!
    On my machine the results are,

    12.7984032 seconds with c#,
    18.827 seconds with Java.

    It is not impossible that you can find some single example that makes Java a little faster. However, of the 10 first tests I did with simple arithmetic loops C# was faster in all, and often a lot more than 10-15%.

    In addition, there are this issue that the Java world has fallen in "hopeless love with computer science" and the "Big J2EE App Servers with EJB" as I said before, and therefore suffer from the average of 8 times performance loss and the 80% projects failure rate as well as productivity and maintenance problems.

    Regards
    Rolf Tollerud
  21. full disclosure[ Go to top ]

    OK Rolf, please post the code that you used, the JVM and .NET version and settings, including command lines, so I can verify your results. If I get the same results, I'd be glad to admit it. However, since I've done quite a bit of .NET and Java performance testing, I have reason to believe that you are not being completely honest. Actually, just knowing you, I have reason to believe that you are not being completely honest.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  22. full disclosure[ Go to top ]

    Ok, Cameron, here is all information. If there are someting missing, tell me and I will provide it.

    H:\01\C#-Java performance test3>java ManyPeople
    Average time: 18456

    H:\01\C#-Java performance test3>ManyPeople
    Total time: 00:00:12.5780864

    C# CLR Version: 1.0.3705.209 (SP1)

    java.vendor: Sun Microsystems Inc.
    java.version: 1.4.1_01
    os.arch: x86
    os.name: Windows XP
    os.version: 5.1


    // Java Create 100,000 people in an ArrayList and access them
    import java.util.*;

    public class ManyPeople
    {
      public static void main(String[] args)
      {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 20; i++)
          new ManyPeople().average();
        long finish = System.currentTimeMillis();
        System.out.println("Average time: " + (finish - start));
      }

      private long average()
      {
        ArrayList list = new ArrayList();
        for (int i = 0; i < 100000; i++)
          list.add(new Person(i, "John " + i));

        long silly = 0;
        for (int i = 0; i < 100000; i++)
          silly += ((Person)list.get(i)).getId();
        return silly;
      }
    }


    // Person.java: a very simple guy
    public class Person
    {
      private int id;
      private String name;

      public Person(int anId, String aName)
      {
        this.id = anId;
        this.name = aName;
      }

      public int getId()
      {
        return this.id;
      }
    }


    // C# Create 100,000 people in an ArrayList and access them
    using System;
    using System.Collections;

    public class ManyPeople
    {
      public static void Main()
      {
        DateTime start = DateTime.Now;
        for (int i = 0; i < 20; i++)
          new ManyPeople().Average();
        DateTime finish = DateTime.Now;
        Console.WriteLine("Total time: " + (finish - start));
      }

      private long Average()
      {
        ArrayList list = new ArrayList();
        for (int i = 0; i < 100000; i++)
          list.Add(new Person(i, "John " + i));

        long silly = 0;
        foreach (Person p in list)
          silly += p.Id;
        return silly / 100000;
      }
    }

    // Person.cs: a very simple guy
    public class Person
    {
      int id;
      string name;

      public Person(int anId, string aName)
      {
        this.id = anId;
        this.name = aName;
      }

      public int Id
      {
        get { return this.id; }
      }
    }

    Regards
    Rolf Tollerud
  23. You didn't read ...[ Go to top ]

    Rolf,

    Go back and read the thread, and re-run the tests with the correct command line.

    If you continue to be a complete moron, I am not going to continue to waste my own time on this.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  24. You mean:

    H:\01\C#-Java performance test3>J:\j2sdk1.4.1_01\bin\java.exe -Xms128m -Xmx128m
    -Xrs -da -dsa -server ManyPeople
    Average time: 10475 ?

    Well, by turning up the java heap size to 128MB You managed to turn -47% to + 22%! (by turning off the GC, which is something that you could never do in production)

    Nice little memory consummation for such a little program, don't you think?

    "I built the .cs and .java files, and ran them with all the defaults, and Java was a bit slower ... probably 15% slower"

    47% slower on my machine..

    Actually, just knowing you, I have reason to believe that you are not being completely honest

    Actually, to people reading all the original thread + this one, including the false bug and everything, - I leave it to the public to decide who is the dishonest among us. In fact, you should have followed my advice at:
    http://www.theserverside.com//home/thread.jsp?thread_id=16398#65656

    In the meanwhile, - keep up your reading!

    Regards
    Rolf Tollerud
  25. Rolf: Well, by turning up the java heap size to 128MB You managed to turn -47% to + 22%! (by turning off the GC, which is something that you could never do in production)

    Setting -Xms and -Xmx to the same value is very common in production, for servers. Try it with different settings, like 32m or 64m ... see if there is any perf difference. It's not "turning off" GC, it is simply allowing the JVM to hold on to memory instead of constantly returning it to -- and then immediately asking for it from -- the OS.

    It is a good question, though, why the JVM isn't better without these settings. I understand the -server setting is optimized for servers (and the -Xrs -da -dsa settings don't make a difference in this particular test) but the relatively poor performance that I saw without tuning the memory size was annoying. In your case, you saw about 50% slower to about 20% faster ... that's an improvement of well over 2:1 with just a couple of command line switches. The default doesn't look very good.

    Rolf: I leave it to the public to decide who is the dishonest among us.

    I documented my error(s). I am not ashamed to learn something from someone else, nor do I mind admitting it. If I were an engineer, I might have a little more pride in my technical skills, but I'm just someone who happens to find it all very interesting.

    I hope you learned something too -- that C# isn't 8 times as fast (or whatever nonsense you claimed), or even any faster at all. Now that it is pretty evident, at least in one test, I hope you also realize that the speed difference (I don't typically see as much as you did) is pretty minor in the scheme of things. In this test (and most tests), Java comes out ahead, but in other tests I can make .NET come out ahead. But, except for some very micro benchmarks, they are pretty close to each other. (In some micro benchmarks, I can show Java to be over 4x as fast as .NET, and I can show .NET to be over 4x as fast as Java ... that's a pretty good indicator that they both have a lot of room to improve.)

    Regarding your non-stop tirade against big app servers, I don't think you know what you're talking about most of the time, but it is obvious that a little company like Caucho with their Resin server can beat the optimized IIS (which is a fast server, and only suffers from its bad security reputation) in most tests, and Resin is pure Java. It really does make one wonder why we don't see that same performance from some of the "bigger boys" in the J2EE space.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  26. worse and worse..[ Go to top ]

    Cameron,

    In some micro benchmarks, I can show Java to be over 4x as fast as .NET, and I can show .NET to be over 4x as fast as Java

    That is perfectly true, only you forget to mention that in most cases it is the latter that is true, - that is , in micro-benchmarks C# comes out as winner 9 times out of 10.

    that C# isn't 8 times as fast

    Don't put something in my mouth which I have not said, it is the "Big J2EE App Servers with EJB" that suffer from an average of 8 times performance loss, which is a different thing.

    In all benchmarks so far, even if it that were done by your own Java zealots -.NET have come out as a first. Moreover, the Java camps refuse to participate or fund any benchmarks, and even forbid their own performance test to be used by .NET.

    Rather embarrassing I would say.

    For me, it seems that the difference in performance accumulate with the complexity of the application. It seems that J2EE have problems with GC, with class loading, with badly written classes, with threads, etc, etc..in short, a mess.

    Regards
    Rolf Tollerud
  27. worse and worse..[ Go to top ]

    Rolf: you forget to mention that in most cases it is the latter that is true, - that is , in micro-benchmarks C# comes out as winner 9 times out of 10.

    The opposite is true: C# (actually, the CLR) comes out well behind in the majority of the micro-benchmarks that I conducted that had wide variance between the two platforms. However, the CLR is not as mature as the Hotspot JVM, so it's not particularly surprising or worrisome. Also, if .NET version 1.1 is any indication, these items are being addressed as time goes on. I would not be surprised to see the CLR draw very close to even, or maybe surpass Hotspot on many micro-benchmarks on Windows.

    However, for you to claim that "C# comes out as winner 9 times out of 10" without any indication of research is irresponsible and probably plain dishonest.

    Rolf: it is the "Big J2EE App Servers with EJB" that suffer from an average of 8 times performance loss

    That's legally actionable in some countries. Do you have any proof? Or are you just making things up as usual?

    Rolf: In all benchmarks so far, even if it that were done by your own Java zealots -.NET have come out as a first.

    First, I don't have any Java zealots. What do you mean to imply by "your own"?

    Second, .NET has definitely not come first in all benchmarks. Please show one public benchmark that was not sponsored by Microsoft that .NET came out ahead in. (I should point out that I wouldn't be surprised if .NET came out ahead in certain tests. If you compare the built-in XML handling in .NET with some of the open source implementations popular in Java, .NET is significantly faster. OTOH, if you compare the commercial Java solutions e.g. TME with .NET, Java has generally been faster.)

    Rolf: Moreover, the Java camps refuse to participate or fund any benchmarks

    Why would they? The J2EE products are already standards-based and industry-accepted. Microsoft is the one that has something to prove with .NET.

    Rolf: For me, it seems that the difference in performance accumulate with the complexity of the application. It seems that J2EE have problems with GC, with class loading, with badly written classes, with threads, etc, etc..in short, a mess.

    What utter nonsense. We've run tests with tens of thousands of classes loaded by class loaders without any performance implication. We've witnessed well-tuned applications with multi-gigabyte heaps that had no noticeable GC pauses. We've seen applications with many hundreds of threads with excellent performance as measured by end user response times. As for "badly written classes", where did you pull that excuse from? Care to name a product? And a class name?

    Your credibility is quickly getting lost in the garbage.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  28. the rest is silence[ Go to top ]

    I have to admit, I am worn out. This just goes on forever.
    You surely have earned your Don Quixote price for defending such a lost cause!

    Good luck!

    from www.it.jobserve.com:

    January 29
    .net: 455
    webLogic: 182 40% of .net

    February 28
    .net 550
    weblogic 210 38% of .net

    March 18
    .net 543
    weblogic 196 36% of .net

    March 29
    .net 531
    weblogic 181 34% of .net

    April 14:
    .net 544
    weblogic 167 32% of .net

    April 30:
    .net 551
    weblogic 173 31% of .net

    May 10:
    .NET 564
    Weblogic 158 28% of of .net

    Regards
    Rolf Tollerud
  29. the rest is silence[ Go to top ]

    Once again Rolf,

    You've gone off on some bizarre tangent.

    Rolf, it's time for us to ask without reserve what your expertise is? Where do you work? What experience do you have either in business or technology? How long? With what technologies? What real projects have you done?

    You spout a lot of stuff: a) without backup and b) without even making sense. Then you make accusations.

    Well: I say the emperor has no clothes!

    You need to speak up and answer the above questions. You need to at least impart some reason such that we would listen to your arguments; which often go over the line of ridiculous.

    We all know what Cameron does. He's well known in our industry. And, having spoken directly with him, and seen/used his product (Coherence), I have a lot more reason to listen to him than you. We all do. We can all download his product and try it. We here him speak on this forum, and he sounds reasonable, experienced and intelligent.

    On top of which, the only one in this forum that sounds like a zealot is you, Rolf.

    Rolf, I've worked on both sides of this issue. I was an MS developer for some time (I've even done Comdex dog-and-pony shows for MS), and am now mostly a Java developer. There's good to both: and Cameron seems to agree throughout this thread.

    Again, you claim so much knowledge and experience with these things, that the time has come for you to speak up, and stop spouting garbage.

    Jason McKerr
    Northwest Alliance for Computational Science and Engineering
  30. desperate?[ Go to top ]

    Hi Rolf,

    Did you just change the subject, or did some alter ego log in under your name and post some off-topic nonsense?

    Could you please answer the above questions? Or alternatively, please admit that you were simply lying and making things up.

    I humbly await your response.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  31. made by a committee..[ Go to top ]

    Hi Cameron,

    Sorry Cameron, I am just tired of discussing with someone that even if he were caught directly in the shower with another girl would stoutly deny everything for the wife.

    But to show that in micro-benchmarks C# comes out as winner 9 times out of 10, maybe you could name a neutral third part that could set up some code to test? Or what?

    Why do you care? Did you not se the statistic? Do you not understand that your valiant fight is soon all in vain?

    Await your suggestion how we can settle the matter with the micro-benchmarks; with default settings - of course.

    Regards
    Rolf Tollerud
  32. made by a committee..[ Go to top ]

    Rolf: if he were caught directly in the shower with another girl would stoutly deny everything for the wife

    First, I don't know how you found out about that, but it's not what you think.

    Second, answer the friggin' question.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  33. I beat Cameron![ Go to top ]

    By setting up the memory to 256MB I have come down to 6.819 seconds!
    (java -Xms256m -Xmx256m -server ManyPeople)

    Then I have a brilliant idea, I plan to set the memory to 512MB!
    (patent pending)

    Stay put for further magnificent records..

    Regards
    Rolf Tollerud
  34. tragic[ Go to top ]

    In other words, you also tried with much lower settings, and Java was noticeably faster, so instead of admitting that you were wrong, you just avoided the topic and posted some meaningless results that (unfortunately for you) show that Java is even faster than anyone suggested!

    Rolf, you're going in the wrong direction. Show me a hero, and I will write you a tragedy.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  35. Hi Cameron,

    It seems that the original thread is not finished yet!

    http://www.theserverside.com/home/thread.jsp?thread_id=16398#82519

    Heres the summary of the results.

    I used cpp as the base line.

    Memory
       Java 2.25 time slower.
       CS 1.1 times slower.

    Factors
       Java 1.5 times slower.
       CS 1.1 times slower.

    File IO
       Java 3.6 times slower
       CS 2.9 times slower.

    Terry Russell:People can discount .NET all they want, but in my mind it has clearly surpassed java performance in most areas. With that said, performance is only one of mainy signifcant areas to concider in evualuating the two platforms. I watch the benchmark results closly, and its clear to me the performance of MS platforms on multi-proc systems is increasing at a rapid pace, and the advantage J2EE has on high end hardware is quickly being removed

    Regards
    Rolf Tollerud
  36. woe is me[ Go to top ]

    Hey Rolf,

    Can you finish losing the first argument before you go starting a new one? I'd rather only have one set of statistics to abuse you with at a time.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  37. why tragic?[ Go to top ]

    I think this performance evaluation is kind of pointless. Are we comparing specific implementations of 2 frameworks, or the frameworks in themselves? If it is the later, then it is nonsense. This is JVM 1.4 against .NET 1.1, not "JAVA" against ".NET" performance evaluation. There are a few implementations of .Net, and lots of implementations of Java, which may run on the same hardware and OS.

    If I one day created my own JVM, and it run slower than .Net, the only conclusion would be that MY implementation is slower, not that Java in itself is slower. Same would be for .Net. So this speed comparison is not such a broad definition of who's faster, in the end.

    And since Sun don't have access to the inner secrets of Windows, as MS has, it would be a shame for MS if .Net VM wasn't faster than Sun's Java VM.
  38. Sorry,

    And I that was just about to publish yet another benchmark!

    I have to restrain myself..

    Henrique Steckelberg:And since Sun don't have access to the inner secrets of Windows, as MS has, it would be a shame for MS if .Net VM wasn't faster than Sun's Java VM

    You are absolutly right!

    Regards
    Rolf Tollerud
  39. tRolf,

    It sounds like you have been unable to get .NET to be faster than Java on that test. Are you going to admit that your claim (.NET is 8x faster or some such nonsense) was made-up nonsense? Or just keep posting ad hominems to try to change the subject? You do realize, I hope, that anyone reading this would just assume that you are too much a loser to admit that you're a liar.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  40. from the "loser"[ Go to top ]

    to Cameron "dishonest" Purdy

    This is the second time you mention that I have said ".NET is 8x faster" - I have never said that!

    What I have said that is that a finished application done with "a big J2EE app Server with EJB" (and you could add O/R mapping and similar nonsense) is an average of 8 times slower than .NET (but also about 8 times slower than for example an Resin application).

    But if you keep on saying it more times maybe someone at last will believe you - but it will not make it more true.

    This is only one example of your dishonesty.

    In all code examples in this thread C# have outperformed Java, except when you cheated by setting up the memory.

    Why do you not try to be more honest? Give it a try!

    Regards
    Rolf Tollerud
  41. one more time[ Go to top ]

    tRolf -

    In all code examples in this thread C# have outperformed Java, except when you cheated by setting up the memory.

    Cheated by setting up the memory? So setting -Xms and -Xmx to the same value is cheating?

    Stop the presses! 499 out of the Fortune 500 (i.e. all the ones that admit to using J2EE as their modern infrastructure) are CHEATING!

    Now that I've stopped laughing ... are you admitting then that Java is faster than .NET or not based on the fact that in your own tests Java was faster?

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  42. from the "loser"[ Go to top ]

    Rolf,

    Once again: It's time maybe for you to tell us what your knowledge, expertise, experience, training, and employment are!

    You're so full of, well whatever, that I'm almost embarrased for you.

    And why is memory management cheating? For Christ's sake, you're arguing memory management WITH A GUY WHO WRITES CACHING SOFTWARE!

    I mean, does that sound retarded to anyone else around here?

    Jason McKerr
    Northwest Alliance for Computational Science and Engineering
  43. to Cameron "dishonest" Purdy

    Cheated by setting up the memory? So setting -Xms and -Xmx to the same value is cheating?

    You know very well that it is the setting of -Xmx (you increased the maximum Java heap size from the default 64MB to 128MB) that is important, why do you try to shuffle the cards?

    -Xms set initial Java heap size
    -Xmx set maximum Java heap size

    The default was 64MB; you set it to 128MB.
    (Not everybody is so easily conned as Jason!)

    Good luck with your shading practice! LOL.

    Regards
    Rolf Tollerud
  44. Rolf,

    If you've ever written a production J2EE application, and you DIDN'T use -Xmx and -Xms, you're basically retarded. They're like, the FIRST thing you set.

    Jeez Rolf. Get a life, or a girlfriend, or a job or something.

    And you still need to answer my questions about your experience.

    Jason McKerr
    Northwest Alliance for Computational Science and Engineering
  45. I should have said,

    If you've ever written ANY JAVA application, not just J2EE.

    Jason McKerr
    Northwest Alliance for Computational Science and Engineering
  46. You know very well that it is the setting of -Xmx (you increased the maximum Java heap size from the default 64MB to 128MB) that is important, why do you try to shuffle the cards?

    >
    > -Xms set initial Java heap size
    > -Xmx set maximum Java heap size
    >
    > The default was 64MB; you set it to 128MB.
    > (Not everybody is so easily conned as Jason!)
    >
    > Good luck with your shading practice! LOL.

    Man, that was the most stupid thing you ever said. Well, up to now, at least! Have you ever heard about database tuning? You call that cheating too? LOL!

    Too bad if .Net doesn't allow for tuning parameters. Makes it less flexible than it already is, compared to Java.
  47. one more time[ Go to top ]

    Well It seems that you have succeeded to convince some of your more weak brained colleagues Cameron. Just as when you were inventing your false bug!

    Some statements by "honest" Cameron:

    "Is that a UAE or a GPF? Unfortunately, with .NET being so quick, I wasn't able to get a good timing for how fast it blew up. Please advise"

    "Regarding .NET performance, we had a thread on that, and I showed (using the .NET developer's own code) that Java was signficantly faster...!

    ASP.NET appears to be the fastest growing is probably just MS shops upgrading of newer versions of IIS… that spit out new headers for ASP.Net

    But go on! You must be desperate at this time.

    Regards
    Rolf Tollerud
  48. one more time[ Go to top ]

    Rolf,

    You're still avoid answering the questions or admitting that you were wrong (or perhaps dishonest). This could go on forever:

    1) Rolf makes stupid claim
    2) Everyone shows claim to be stupid
    3) Even Rolf posts results showing claim to be stupid
    4) Rolf tries to change subject before anyone notices

    Cameron: "Is that a UAE or a GPF? Unfortunately, with .NET being so quick, I wasn't able to get a good timing for how fast it blew up. Please advise"

    First, it was a UAE (Unhandled Application Exception). If I had understood what I was seeing at the time, I could have easily try..catch'ed it. I didn't understand, and after learning what it was, I publicly admitted my error. I don't mind being wrong ... sometimes that's the best way to learn something new! Rolf, you shouldn't be so scared of being wrong. Your ego is obstructing your ability to reason!

    Cameron: "Regarding .NET performance, we had a thread on that, and I showed (using the .NET developer's own code) that Java was signficantly faster...!"

    Not only did I show it, and the .NET zealot did not have a response (hmm ... they kind of disappeared after their own code showed Java to be significantly faster), but you reproduced the results yourself. Java was definitely faster! On that test submitted by a .NET developer, Java is faster, isn't it? Yes or no?

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!

    p.s. I can see the future ... Rolf will either not respond, or try to change the subject.
  49. one last time[ Go to top ]

    Well It seems that you have succeeded to convince some of your more weak brained colleagues Cameron. Just as when you were inventing your false bug!

    >
    > Some statements by "honest" Cameron:
    >
    > "Is that a UAE or a GPF? Unfortunately, with .NET being so quick, I wasn't able to get a good timing for how fast it blew up. Please advise"
    >
    > "Regarding .NET performance, we had a thread on that, and I showed (using the .NET developer's own code) that Java was signficantly faster...!
    >
    > “ASP.NET appears to be the fastest growing is probably just MS shops upgrading of newer versions of IIS… that spit out new headers for ASP.Net
    >
    > But go on! You must be desperate at this time.
    >
    > Regards
    > Rolf Tollerud

    Rolf, have you run out of technical arguments? You despise personal attacks so much, yet you do it everytime you're cornered. Well, not really. Sometimes you come up with "statistics" and "trends". Can you stay on the subject, for a change? People would not regard you as a "troll" if you did.

    I hope your personal war against Java finally gets you somewhere. Better yet if it is far from here. It is so boring sometimes.
  50. one more time[ Go to top ]

    I accept your apology for the first claim. But did you notice all this people screaming with glee instead of using their brains? (just as now?)

    Cameron: "Regarding .NET performance, we had a thread on that, and I showed (using the .NET developer's own code) that Java was signficantly faster...!"

    What you have shown is that the Java example is faster if you have 5 times as much memory. Nothing that has anything to do with production, to be economic with memory is paramount..

    Conclusion:
    With all things equal, C# is faster.
    With 5 times as much memory (128MB), Java is faster.

    So maybe we can close this discussion.

    Regards
    Rolf Tollerud
  51. one more time[ Go to top ]

    Rolf: I accept your apology for the first claim.

    How big of you! I graciously accept your apology, and hope we can be friends again. I have missed our friendship dearly!

    Rolf: What you have shown is that the Java example is faster if you have 5 times as much memory.

    No, that is what you have shown. Now please publish your results with different heap sizes smaller than 128MB of memory. Java (Sun's Hotspot JVM for example) doesn't typically need any more memory than the CLR to equal or surpass the CLR performance.

    (And, as I've said before, there is nothing embaressing about the .NET performance, because it's already within 10-15% of Java's performance on Windows, and getting better with each release. However, I understand that as a .NET zealot that is very hard for you to swallow. I pity your lack of self-confidence that you would attempt to make up for your own perceived shortcomings by subrogating the desired performance of the CLR in lieu of your own personal capabilities. You really are a better person than that, Rolf. And gosh-darnit, people like you!)

    Rolf: "Conclusion: With all things equal, C# is faster."

    But your tests showed the opposite! Next you'll ask us to believe that black is white!

    Rolf: "With 5 times as much memory (128MB), Java is faster."

    Yes, that is true, but Java is also faster with the same amount of memory, too! You apparently have run those tests and found that out, which is why you are avoiding publishing your results.

    Rolf: "So maybe we can close this discussion."

    I'd be glad to, as soon as you publish the results for lesser amounts of memory (e.g. Java's default of 64m heap size by using -Xms64m and -Xmx64m ... or even less if you want) and stop your blatant attempts at dishonesty, finger-pointing, ad hominem attacks and subject-switching.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!

    p.s. I foresee Rolf trying to figure out the very minimum heap size that the test will run in, and forcing that as a max to cause repeated full GCs. Otherwise, he won't be able to post any results, because they will show the CLR trailing every time.
  52. Cameron,

    > -Xms set initial Java heap size (default 0)
    > -Xmx set maximum Java heap size (default 64MB)

    1)
    If I run the test with default (java -server ManyPeople), then the test use about 20MB at the max. The default value of -Xms is 0, in other words the VM decide how much memory to use. So it doesn't use the full maximum of 64MB (very reasonable).

    To compare the C# app use about 18MB as max, about the same!

    The results?
    12.80 seconds with c#,
    18.83 seconds with Java.

    2)
    When you set the -Xms to same as -Xmx
    (java -Xms64m -Xmx64m -server ManyPeople)

    Then the app use the full maximum 64MB, it even says 67MB in my monitor!

    So, this setting gives more than 3 times as much memory..
    The results?
    13.57 seconds

    Still not beating C#, in spite of 3 times as much memory.

    Regards
    Rolf Tollerud
  53. Thank you Rolf for posting your results. I have previously tested with 32MB and 64MB (ms=mx in both cases) and the Java version was measurably faster. However, I will accept your results as being accurate, since I have no basis to claim that you saw something different, and if I get a chance, I will re-run my tests with the latest and greatest of both .NET and Java, and post the results too, even if Java is slower. I do have some suspicion that somehow my numbers will differ, but until I do the work or running it, I guess I should hold my tongue.

    Rolf: java -Xms64m -Xmx64m -server ManyPeople

    Yes. Also try with 24, 32, 40, etc. See what difference, if any, it makes. Please post your results so I have something to compare to.

    Rolf: 12.80 seconds with c#, ... 13.57 seconds [Java] ... Still not beating C#

    You are seeing a 6% advantage for the CLR. Also, as you point out, Java has more memory available than it should need.

    Rolf: Then the app use the full maximum 64MB, it even says 67MB in my monitor!

    64MB refers to the heap size. The JVM itself uses memory on the stack, plus memory allocated from the OS for its own needs. The "heap" is just for the Java objects themselves. With native JDBC drivers, for example, it is possible to see many MB beyond the Java heap size being used, because the drivers are not storing their data on the Java heap, but in their C/C++ heap (where C++ "new" and C "malloc()" get memory from).

    The CLR is very similar in its approach, although uses some different words.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  54. Cameron,

    Here are the results. This time I have run each test 3 times (best of 3).
    The last column is the total memory consumption.

    java-Xms20m -Xmx20m -server ManyPeople (25MB)
    Average time: 17686

    java -Xms24m -Xmx24m -server ManyPeople (29MB)
    Average time: 13460

    java -Xms32m -Xmx32m -server ManyPeople (37MB)
    Average time: 13550

    java -Xms40m -Xmx40m -server ManyPeople (45MB)
    Average time: 13340

    java -Xms64m -Xmx64m -server ManyPeople (67MB)
    Average time: 12098

    It is a strange that the little gap from 20 to 24 MB gives so much better results!

    Regards
    Rolf Tollerud
  55. It is a strange that the little gap from 20 to 24 MB gives so much better results!


    Probably the GC is starting to run wild when you limit heap to 20MB, since the program may be trying to allocate more than that, kicking off garbage collecting with a higher frequency, thus affecting performance.
  56. Rolf,

    Let me start by saying that the results I got were a bit unexpected. Don't get your hopes up, though ;-)

    I tested on the following versions:

    .NET 1.0sp2:
    Microsoft (R) Visual C# .NET Compiler version 7.00.9466
    for Microsoft (R) .NET Framework version 1.0.3705
    Copyright (C) Microsoft Corporation 2001. All rights reserved.


    .NET 1.1:
    Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
    for Microsoft (R) .NET Framework version 1.1.4322
    Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.


    Sun Hotspot Server JVM from JDK 1.3.1_04:
    java version "1.3.1_04"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_04-b02)
    Java HotSpot(TM) Server VM (build 1.3.1_04-b02, mixed mode)


    Sun Hotspot Server JVM from JDK 1.4.0_02:
    java version "1.4.0_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_02-b02)
    Java HotSpot(TM) Server VM (build 1.4.0_02-b02, mixed mode)


    Sun Hotspot Server JVM from JDK 1.4.1_02:
    java version "1.4.1_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
    Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)


    I tested all JVMs with 24, 32, 40, 48, 56, and 64MB of memory by setting -Xms equal to -Xmx. I used the -server command line switch to force the server version of the VM. Otherwise, there were no switches used.

    I undid your bastardization of my code a little bit. Here is the code, in full:

    C#

    // C# Create 100,000 people in an ArrayList and access them
    using System;
    using System.Collections;

    public class ManyPeople
    {
      public static void Main()
      {
        for (int i = 0; i < 100; i++)
          test(i);
      }
      
      public static void test(int iIter)
      {
        DateTime start = DateTime.Now;
        for (int i = 0; i < 20; i++)
          new ManyPeople().Average();
        DateTime finish = DateTime.Now;
        Console.WriteLine("Total time for iteration " + iIter + ": " + (finish - start));
      }

      private long Average()
      {
        ArrayList list = new ArrayList(100000);
        for (int i = 0; i < 100000; i++)
          list.Add(new Person(i, "John " + i));

        long silly = 0;
        foreach (Person p in list)
          silly += p.Id;
        return silly / 100000;
      }
    }

    // Person.cs: a very simple guy
    public class Person
    {
      int id;
      string name;

      public Person(int anId, string aName)
      {
        this.id = anId;
        this.name = aName;
      }

      public int Id
      {
        get { return this.id; }
      }
    }

    Java:

    // Java Create 100,000 people in an ArrayList and access them
    import java.util.*;

    public class ManyPeople
    {
      public static void main(String[] args)
      {
        for (int i = 0; i < 100; i++)
          test(i);
      }
      
      public static void test(int iIter)
      {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 20; i++)
          new ManyPeople().average();
        long finish = System.currentTimeMillis();
        System.out.println("Total time for iteration " + iIter + ": " + (finish - start));
      }

      private long average()
      {
        ArrayList list = new ArrayList(100000);
        for (int i = 0; i < 100000; i++)
          list.add(new Person(i, "John " + i));

        long silly = 0;
        for (int i = 0; i < 100000; i++)
          silly += ((Person)list.get(i)).getId();
        return silly;
      }
    }

    // Person.java: a very simple guy
    class Person
    {
      private int id;
      private String name;

      public Person(int anId, String aName)
      {
        this.id = anId;
        this.name = aName;
      }

      public int getId()
      {
        return this.id;
      }
    }

    end code

    The changes allow me to see the first run (which with Hotspot is interpreted) versus the other runs.

    Before running, I cleaned up my task manager, registry, etc. to minimize other processes running, and rebooted my Windows 2000 sp2 (?) notebook, which is a P3-1Ghz with 1GB RAM. Here are the results (just first six runs per):

    .NET 1.0sp2:

    ManyPeople
    Total time for iteration 0: 00:00:07.3004976
    Total time for iteration 1: 00:00:07.0501376
    Total time for iteration 2: 00:00:07.2504256
    Total time for iteration 3: 00:00:07.7311168
    Total time for iteration 4: 00:00:07.5007856
    Total time for iteration 5: 00:00:07.5007856

    (I ran it several times; these were the best times I got for .NET 1.0sp2.)


    .NET 1.1:

    ManyPeople
    Total time for iteration 0: 00:00:08.0916352
    Total time for iteration 1: 00:00:08.5222544
    Total time for iteration 2: 00:00:08.3520096
    Total time for iteration 3: 00:00:08.6324128
    Total time for iteration 4: 00:00:08.3419952
    Total time for iteration 5: 00:00:08.1617360

    (Yes, you read the numbers correctly. In this test, .NET 1.1 was about 15% slower than .NET 1.0sp2. I will say that this is unusual from my benchmarking experience; the 1.1 release is definitely faster than the 1.0sp2 release for most types of applications.)


    Sun Hotspot Server JVM from JDK 1.3.1_04:

    java -server -Xms24m -Xmx24m ManyPeople
    Total time for iteration 0: 8101
    Total time for iteration 1: 7852
    Total time for iteration 2: 7851
    Total time for iteration 3: 7851
    Total time for iteration 4: 7841
    Total time for iteration 5: 7842

    java -server -Xms32m -Xmx32m ManyPeople
    Total time for iteration 0: 7822
    Total time for iteration 1: 7540
    Total time for iteration 2: 7451
    Total time for iteration 3: 7541
    Total time for iteration 4: 7541
    Total time for iteration 5: 7441

    java -server -Xms40m -Xmx40m ManyPeople
    Total time for iteration 0: 7901
    Total time for iteration 1: 7180
    Total time for iteration 2: 7171
    Total time for iteration 3: 7170
    Total time for iteration 4: 7190
    Total time for iteration 5: 7171

    java -server -Xms48m -Xmx48m ManyPeople
    Total time for iteration 0: 8122
    Total time for iteration 1: 7160
    Total time for iteration 2: 7160
    Total time for iteration 3: 7170
    Total time for iteration 4: 7161
    Total time for iteration 5: 7170

    java -server -Xms56m -Xmx56m ManyPeople
    Total time for iteration 0: 7801
    Total time for iteration 1: 7371
    Total time for iteration 2: 8021
    Total time for iteration 3: 8012
    Total time for iteration 4: 8011
    Total time for iteration 5: 8022

    java -server -Xms64m -Xmx64m ManyPeople
    Total time for iteration 0: 7941
    Total time for iteration 1: 7701
    Total time for iteration 2: 7731
    Total time for iteration 3: 8022
    Total time for iteration 4: 7741
    Total time for iteration 5: 7731


    Sun Hotspot Server JVM from JDK 1.4.0_02:

    java -server -Xms24m -Xmx24m ManyPeople
    Total time for iteration 0: 8022
    Total time for iteration 1: 7851
    Total time for iteration 2: 7881
    Total time for iteration 3: 7802
    Total time for iteration 4: 7841
    Total time for iteration 5: 7861

    java -server -Xms32m -Xmx32m ManyPeople
    Total time for iteration 0: 7801
    Total time for iteration 1: 7581
    Total time for iteration 2: 7491
    Total time for iteration 3: 7591
    Total time for iteration 4: 7581
    Total time for iteration 5: 7490

    java -server -Xms40m -Xmx40m ManyPeople
    Total time for iteration 0: 8742
    Total time for iteration 1: 8192
    Total time for iteration 2: 8182
    Total time for iteration 3: 8191
    Total time for iteration 4: 8182
    Total time for iteration 5: 8192

    java -server -Xms48m -Xmx48m ManyPeople
    Total time for iteration 0: 7962
    Total time for iteration 1: 7961
    Total time for iteration 2: 8012
    Total time for iteration 3: 8061
    Total time for iteration 4: 7922
    Total time for iteration 5: 8071

    java -server -Xms56m -Xmx56m ManyPeople
    Total time for iteration 0: 7882
    Total time for iteration 1: 7661
    Total time for iteration 2: 7751
    Total time for iteration 3: 7761
    Total time for iteration 4: 7761
    Total time for iteration 5: 7701

    java -server -Xms64m -Xmx64m ManyPeople
    Total time for iteration 0: 7951
    Total time for iteration 1: 7481
    Total time for iteration 2: 7290
    Total time for iteration 3: 7301
    Total time for iteration 4: 7441
    Total time for iteration 5: 7300


    Sun Hotspot Server JVM from JDK 1.4.1_02:

    java -server -Xms24m -Xmx24m ManyPeople
    Total time for iteration 0: 8352
    Total time for iteration 1: 8071
    Total time for iteration 2: 8102
    Total time for iteration 3: 8021
    Total time for iteration 4: 8072
    Total time for iteration 5: 8062

    java -server -Xms32m -Xmx32m ManyPeople
    Total time for iteration 0: 7580
    Total time for iteration 1: 7491
    Total time for iteration 2: 7391
    Total time for iteration 3: 7511
    Total time for iteration 4: 7490
    Total time for iteration 5: 7391

    java -server -Xms40m -Xmx40m ManyPeople
    Total time for iteration 0: 8482
    Total time for iteration 1: 8132
    Total time for iteration 2: 8122
    Total time for iteration 3: 8121
    Total time for iteration 4: 8112
    Total time for iteration 5: 8132

    java -server -Xms48m -Xmx48m ManyPeople
    Total time for iteration 0: 7701
    Total time for iteration 1: 7571
    Total time for iteration 2: 7671
    Total time for iteration 3: 7771
    Total time for iteration 4: 7631
    Total time for iteration 5: 7801

    java -server -Xms56m -Xmx56m ManyPeople
    Total time for iteration 0: 7651
    Total time for iteration 1: 7571
    Total time for iteration 2: 7661
    Total time for iteration 3: 7661
    Total time for iteration 4: 7681
    Total time for iteration 5: 7621

    java -server -Xms64m -Xmx64m ManyPeople
    Total time for iteration 0: 7901
    Total time for iteration 1: 7571
    Total time for iteration 2: 7411
    Total time for iteration 3: 7420
    Total time for iteration 4: 7561
    Total time for iteration 5: 7411


    Sun Hotspot Client JVM from JDK 1.4.1_02:

    java -Xms64m -Xmx64m ManyPeople
    Total time for iteration 0: 8322
    Total time for iteration 1: 8382
    Total time for iteration 2: 8362
    Total time for iteration 3: 8602
    Total time for iteration 4: 8432
    Total time for iteration 5: 8352

    (Included just to show it falls behind the server JVM for a CPU-bound test.)

    (end of benchmarks)


    And now, for the bad news. If we look at the .NET CLR, being a simple JIT, it never improves over time. On the other hand, the Hotspot Server only widens its performance lead, particularly in a "server" configuration where it isn't so heap constrained:

    Sun Hotspot Server JVM from JDK 1.4.1_02:

    java -server -Xms128m -Xmx128m ManyPeople
    Total time for iteration 0: 6370
    Total time for iteration 1: 5788
    Total time for iteration 2: 5868
    Total time for iteration 3: 6029
    Total time for iteration 4: 5748
    Total time for iteration 5: 5738
    Total time for iteration 6: 5729
    Total time for iteration 7: 5948
    Total time for iteration 8: 5688
    Total time for iteration 9: 5679
    Total time for iteration 10: 5658
    ...
    Total time for iteration 80: 4676
    Total time for iteration 81: 4807
    Total time for iteration 82: 4417
    Total time for iteration 83: 4296
    Total time for iteration 84: 4686
    Total time for iteration 85: 4797
    Total time for iteration 86: 4266
    Total time for iteration 87: 4697
    Total time for iteration 88: 4617
    Total time for iteration 89: 4717
    Total time for iteration 90: 4276
    Total time for iteration 91: 4707
    Total time for iteration 92: 4616
    Total time for iteration 93: 4697
    Total time for iteration 94: 4296
    Total time for iteration 95: 4677
    Total time for iteration 96: 4546
    Total time for iteration 97: 4697
    Total time for iteration 98: 4296
    Total time for iteration 99: 4677


    Yup, that's right. The Sun Hotspot server edition eventually widens its lead to the point where it is running almost two times as fast as .NET version 1.1! While the CLR couldn't get below 8 seconds, starting with the 23rd iteration, the Sun Hotspot server JVM never went above 5 seconds! So for applications that don't just open and close, the Hotspot JVM absolutely wipes the floor with the latest and greatest Microsoft CLR.

    Does it matter? Only if Rolf and/or Microsoft attempt to perpetuate the falsehood that somehow the CLR is faster. Because for enterprise applications, it is obviously way behind the performance capability of the modern JVMs.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  57. here we go again[ Go to top ]

    Sorry it should be,

    java -server -Xms20m -Xmx20m ManyPeople
  58. here we go again[ Go to top ]

    Cameron,

    Well the only new information here is that .NET 1.1 is slower that 1.0. I have not installed 1.1 yet but I take your word for it.

    The other tests just showed that with more memory, java is faster.

    Even in your lowest setting, (java -server -Xms24m -Xmx24m ManyPeople) the app have a total of ca 29MB.

    To ensure that the Java app use only about 20MB (the same amount of memory as the .NET), you need to put:

    java -server ManyPeople (or, alternatively)
    java -server -Xms20m -Xmx20m -server ManyPeople

    But of course you leaved out these ones..

    So I will still claim:

    "With the same amount of memory, .NET is faster"

    Regards
    Rolf Tollerud
  59. ?[ Go to top ]

    How could my second post come out before my first?
  60. post ordering[ Go to top ]

    TSS apparently uses System.currentTimeMillis() to order messages, but runs in a cluster with different servers being slightly off in their time.

    Since they are running Tangosol Coherence, they should use Cluster.getTimeMillis(), which provides the current agreed-upon time in the cluster.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  61. Silence[ Go to top ]

    And then, there was silence on the board.....

    Well done.
  62. Nope[ Go to top ]

    I spoke too soon......
  63. there we went again[ Go to top ]

    Rolf: Well the only new information here is that .NET 1.1 is slower that 1.0. I have not installed 1.1 yet but I take your word for it.

    .NET 1.1 is faster than .NET 1.0, just not in this test for some reason.

    Rolf: To ensure that the Java app use only about 20MB (the same amount of memory as the .NET)

    Are you sure that is the same amount of memory? You do understand (right?) that there are some shared components in .NET that inflate the amount of memory that the OS uses, but doesn't show up in the .NET process itself.

    Rolf: So I will still claim: "With the same amount of memory, .NET is faster"

    You could be right in this particular case. For example, that's how Microsoft proved that Windows NT 3.5 was 2x faster than Windows NT 3.1 (by running it on a computer with only 12MB RAM when 3.1 required 16MB), so it seems only natural to find some similar way to show Microsoft .NET being faster -- by limiting memory on something.

    Luckily, most modern servers are not limited to 20MB of RAM, and most server processes are not limited to 20MB either!

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!
  64. finish for now..[ Go to top ]

    Cameron:"Luckily, most modern servers are not limited to 20MB of RAM, and most server processes are not limited to 20MB either!"

    What? There can be thousands of threads, - if everyone needs twice as much memory you are in trouble..

    I admit that there is a tiny little spark of doubt that cannot be settled before we find a way to set up the memory for the .NET app the same way as in Java.

    So, until then, let us rest the matter where it is.

    So i will not say: "The emperor is not so forgiving as I am!"

    But, the merriest month in all the year
    Is the merry month of May

    Regards
    Rolf Tollerud
  65. Off Topic... May[ Go to top ]

    Hi Rolf,

    > But, the merriest month in all the year
    > Is the merry month of May

    My father once told me a saying about May:
    "Hey Hey it's the 1st of May, outdoor screwing begins today!!!"

    Later,
    Rob Misek
    Tangosol, Inc.
    Coherence: Cluster your Work. Work your Cluster.
  66. Off Topic... May[ Go to top ]

    Rolf: You are clearly the most important reason for me to reduce my visits to TSS, since it's somehow both annoying and fascinating at the same time to look at discussions you are involved in. Annoying, because you are dishonest, post half-truths, and make a lot of threads almost unreadable; fascinating, because I have never somebody (apart from some politicians) evade direct questions as gracefully as you do.

    I mean how much of an ass do you have to be for the team running the site to have implemented a 'noisy' feature just because of you? (Of course I'm not sure about that, but I can't think of another reason ;-) )

    So please - answer Jason's question:

    <quote>
    Rolf, it's time for us to ask without reserve what your expertise is? Where do you work? What experience do you have either in business or technology? How long? With what technologies? What real projects have you done?
    </quote>
  67. Weird[ Go to top ]

    Does anybody know why changing the loop in the C# version from

        for (int i = 0; i < 100000; i++) {
          list.Add(new Person(i, "John " + i);
        }

    which runs like this :

    C:\temp\cstest>ManyPeople.exe
    Total time for iteration 0: 00:00:04.0958896
    Total time for iteration 1: 00:00:04.5064800
    Total time for iteration 2: 00:00:04.7167824
    Total time for iteration 3: 00:00:04.5064800
    Total time for iteration 4: 00:00:04.5064800

    to

        for (int i = 0; i < 100000; i++) {
          list.Add(new Person(i, "John " + i.ToString());
        }

    makes it significantly faster :

    C:\temp\cstest>ManyPeople.exe
    Total time for iteration 0: 00:00:02.9542480
    Total time for iteration 1: 00:00:03.0744208
    Total time for iteration 2: 00:00:03.0944496
    Total time for iteration 3: 00:00:02.9342192
    Total time for iteration 4: 00:00:03.0043200

    ???
  68. expertise..[ Go to top ]

    Stefan,

    My expertise is to irritate people that have an inflated opinion of themselves or their work!
    Preferably in a funny way so to provide an entertainment value, for myself and others.

    Do you have a problem with that?

    Regards
    Rolf Tollerud
  69. Rolf's occupation[ Go to top ]

    Jason,

    You're not the only one interested about Rolf's experience. Rolf, come on! Tell us about your job! Is it a MS salesperson?

    The absence of an answer will indicate that he is.
  70. expertise..[ Go to top ]

    Rolf I think you need to check into AA or something
  71. Re:Weird[ Go to top ]

    <quote>
    Does anybody know why changing the loop in the C# version from

        for (int i = 0; i < 100000; i++) {
          list.Add(new Person(i, "John " + i);
        }
    </quote>
    to
    <quot>
    to

        for (int i = 0; i < 100000; i++) {
          list.Add(new Person(i, "John " + i.ToString());
        }

    </quote>
    There is a box operation going on for i in "John"+ i compares with "John" + i.ToString() which involves an object allocation whereas the second case involves a static method call to convert the integer to string b4 string concatenation is called. So the second case is more efficient.

    Regards,
    Hun Boon
  72. expertise..[ Go to top ]

    Stefan,

    >
    > My expertise is to irritate people that have an inflated opinion of themselves or their work!

    So you have to irritate yourself most of the time?

    > Preferably in a funny way so to provide an entertainment value, for myself and others.
    >
    > Do you have a problem with that?
    >

    As I wrote - sometimes I like watching somebody behave stupidly. Most of the time, I don't, so I usually ignore your posts.

    Stefan

    > Regards
    > Rolf Tollerud
  73. Re:Weird[ Go to top ]

    Aha. Thanks for the explanation.
  74. digging in the wrong place[ Go to top ]

    Ok,I found the thread,

    >
    > First Edgar Sanchez gives this example, (http://www.theserverside.com//home/thread.jsp?thread_id=16398#65446):
    >
    > adding a cent 10 million times. Java first:
    >
    > import java.math.BigDecimal;
    > import java.util.Date;
    >
    > public class DecimalAdd {
    >   public static void main(String[] args) {
    >     BigDecimal oneCent = new BigDecimal("0.01");
    >
    >     Date start = new Date();
    >     BigDecimal total = new BigDecimal(0);
    >     for (int i = 0; i < 10000000; i++)
    >       total = total.add(oneCent);
    >     Date finish = new Date();
    >
    >     System.out.println("Total: " + total);
    >     System.out.println("Time: " + (finish.getTime() - start.getTime()));
    >   }
    > }
    >
    > And C#:
    >
    > using System;
    >
    > public class DecimalAdd
    > {
    >   public static void Main()
    >   {
    >     decimal oneCent = 0.01m;
    >
    >     DateTime start = DateTime.Now;
    >     decimal total = 0m;
    >     for (int i = 0; i < 10000000; i++)
    >       total += oneCent;
    >     DateTime finish = DateTime.Now;
    >
    >     Console.WriteLine("Total: " + total);
    >     Console.WriteLine("Time: " + (finish - start));
    >   }
    > }
    >
    > <Edgar>In this very machine, Java takes from 15.3 to 22.4 seconds, C# takes from 1.2 to 1.4 seconds, that doesn't look like 10 to 20% faster to me...</Edgar>
    >
    > In my machine: C# 1.7 seconds, Java 10.6 seconds.
    >
    > In answer to that, you change the test so that the C# example gets an overflow. And you say,
    > (http://www.theserverside.com//home/thread.jsp?thread_id=16398#65501):
    >
    > <Cameron>Application has generated an exception that could not be handled.
    > Process id=0x3dc (988), Thread id=0x1b4 (436).
    >
    > Is that a UAE or a GPF? Unfortunately, with .NET being so quick, I wasn't able to get a good timing for how fast it blew up. Please advise"
    </Cameron>
    >
    > Then for some time in the thread people glee over the supposed C# bug until, Adi Oltean from Microsoft informs that it is an unhandled exception (http://www.theserverside.com//home/thread.jsp?thread_id=16398#65673)
    >
    > Thereafter you come with your apology, (http://www.theserverside.com//home/thread.jsp?thread_id=16398#65707):
    >
    > <Cameron>My apologies. That makes sense now, since the console application didn't perform any exception handling</Cameron>
    >
    > The result of all this fuss is that now have everybody forgot about the performance issue! (Normal behavior in dishonest discussions)
    >
    > Then in your Weblog (http://www.freeroller.net/page/cpurdy/20021118), not in the thread! - you claim that after some settings with -Xms and -Xmx Java now suddenly performs 30% better! So C# 1.7 seconds, Java 10.6 seconds is now history..
    >
    > This reminds me of Oracle when they claimed that their "PetShop" with some minor tweaks suddenly was 560 times faster..
    >
    > Cameron, I do not know what you are doing - but it is certainly entertaining!
    >
    > Regards
    > Rolf Tollerud

    <Edgar>In this very machine, Java takes from 15.3 to 22.4 seconds, C# takes from 1.2 to 1.4 seconds, that doesn't look like 10 to 20% faster to me...</Edgar>

    Just now trying to follow this thread...what type of machine just used to yield the results 15.3 - 22.4. Everytime I ran this test, i got 2.8 and below

    Just incase you wondering p4, 1g Ram