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
-
.NET webservices outperforms J2EE webservices in new test (73 messages)
- Posted by: Jon Martin Solaas
- Posted on: May 07 2003 05:53 EDT
Threaded Messages (73)
- .NET webservices outperforms J2EE webservices in new test by Cameron Purdy on May 08 2003 14:09 EDT
- no, not again.. by Rolf Tollerud on May 08 2003 20:56 EDT
- a modest proposal.. by Rolf Tollerud on May 08 2003 21:01 EDT
- a modest proposal.. by Cameron Purdy on May 08 2003 21:39 EDT
- work is not all by Rolf Tollerud on May 09 2003 00:31 EDT
- work is not all by Jason McKerr on May 09 2003 01:14 EDT
- work is not all by Jason McKerr on May 09 2003 01:16 EDT
- work is not all by Cameron Purdy on May 09 2003 09:05 EDT
- beauty is truth, truth is beauty by Rolf Tollerud on May 09 2003 19:15 EDT
- beauty is truth, truth is beauty by Cameron Purdy on May 09 2003 21:52 EDT
- Cameron reads a book! by Rolf Tollerud on May 10 2003 02:37 EDT
- what code.. by Rolf Tollerud on May 10 2003 05:47 EDT
- what code.. by Cameron Purdy on May 10 2003 08:48 EDT
- what code.. by Rolf Tollerud on May 10 2003 09:27 EDT
- what code.. by Cameron Purdy on May 10 2003 10:52 EDT
- digging in the wrong place by Rolf Tollerud on May 10 2003 13:00 EDT
- digging in the wrong place by Cameron Purdy on May 10 2003 18:50 EDT
- digging in the wrong place by Cameron Purdy on May 10 2003 18:58 EDT
- strange results on Camerons computer.. by Rolf Tollerud on May 10 2003 23:38 EDT
- full disclosure by Cameron Purdy on May 11 2003 13:34 EDT
- full disclosure by Rolf Tollerud on May 11 2003 14:39 EDT
- You didn't read ... by Cameron Purdy on May 11 2003 17:36 EDT
- department of squirming excuses.. by Rolf Tollerud on May 11 2003 19:07 EDT
- department of squirming excuses.. by Cameron Purdy on May 12 2003 07:58 EDT
- worse and worse.. by Rolf Tollerud on May 12 2003 10:23 EDT
- worse and worse.. by Cameron Purdy on May 12 2003 11:59 EDT
- the rest is silence by Rolf Tollerud on May 12 2003 12:40 EDT
- the rest is silence by Jason McKerr on May 12 2003 12:54 EDT
- desperate? by Cameron Purdy on May 12 2003 13:08 EDT
- made by a committee.. by Rolf Tollerud on May 12 2003 13:54 EDT
- made by a committee.. by Cameron Purdy on May 12 2003 14:03 EDT
- I beat Cameron! by Rolf Tollerud on May 13 2003 02:10 EDT
- tragic by Cameron Purdy on May 13 2003 08:21 EDT
- tragic, in spite of Camerons hopeless Don Quixote efforts by Rolf Tollerud on May 14 2003 00:55 EDT
- woe is me by Cameron Purdy on May 14 2003 11:58 EDT
- why tragic? by Henrique Steckelberg on May 14 2003 13:01 EDT
- must to be careful with Cameron, he is not young anymore.. by Rolf Tollerud on May 14 2003 14:50 EDT
- don't try to change the subject by Cameron Purdy on May 14 2003 15:53 EDT
- from the "loser" by Rolf Tollerud on May 14 2003 16:26 EDT
- one more time by Cameron Purdy on May 14 2003 16:48 EDT
- from the "loser" by Jason McKerr on May 14 2003 17:40 EDT
- would you buy a used car from Cameron? by Rolf Tollerud on May 14 2003 18:52 EDT
- would you buy a used car from Cameron? by Jason McKerr on May 14 2003 18:58 EDT
- would you buy a used car from Cameron? by Jason McKerr on May 14 2003 19:35 EDT
- would you buy a used brain from Rolf? by Henrique Steckelberg on May 14 2003 20:41 EDT
- one more time by Rolf Tollerud on May 14 2003 23:28 EDT
- one more time by Cameron Purdy on May 15 2003 08:25 EDT
- one last time by Henrique Steckelberg on May 15 2003 08:25 EDT
- one more time by Rolf Tollerud on May 15 2003 11:15 EDT
- one more time by Cameron Purdy on May 15 2003 11:59 EDT
- so the discussion was not closed! by Rolf Tollerud on May 15 2003 12:36 EDT
- so the discussion was not closed! by Cameron Purdy on May 15 2003 12:53 EDT
- java is faster on second run (with 64MB) by Rolf Tollerud on May 15 2003 14:05 EDT
- java is faster on second run (with 64MB) by Henrique Steckelberg on May 15 2003 16:00 EDT
- Java is apparently faster in general by Cameron Purdy on May 16 2003 13:47 EDT
- here we go again by Rolf Tollerud on May 16 2003 14:34 EDT
- here we go again by Rolf Tollerud on May 16 2003 14:35 EDT
- ? by Rolf Tollerud on May 16 2003 14:35 EDT
- post ordering by Cameron Purdy on May 16 2003 14:46 EDT
- Silence by Elaine Brownson on May 16 2003 14:50 EDT
- Nope by Elaine Brownson on May 16 2003 14:51 EDT
- there we went again by Cameron Purdy on May 16 2003 14:52 EDT
- finish for now.. by Rolf Tollerud on May 16 2003 15:31 EDT
- Off Topic... May by Rob Misek on May 16 2003 16:21 EDT
- Off Topic... May by Stefan Tilkov on May 16 2003 17:11 EDT
- Weird by Dimitri Rakitine on May 16 2003 17:26 EDT
- expertise.. by Rolf Tollerud on May 16 2003 17:33 EDT
- Rolf's occupation by Nipsu on May 16 2003 17:45 EDT
- expertise.. by Matthew Cox on May 16 2003 19:16 EDT
- Re:Weird by Hun Boon Teo on May 17 2003 02:55 EDT
- expertise.. by Stefan Tilkov on May 17 2003 15:50 EDT
- Re:Weird by Dimitri Rakitine on May 17 2003 23:12 EDT
- digging in the wrong place by kabal on May 18 2003 14:41 EDT
-
.NET webservices outperforms J2EE webservices in new test[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 08 2003 14:09 EDT
- in response to Jon Martin Solaas
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! -
no, not again..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 08 2003 20:56 EDT
- in response to Jon Martin Solaas
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 -
a modest proposal..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 08 2003 21:01 EDT
- in response to Jon Martin Solaas
Have you read Don Quixote yet? -
a modest proposal..[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 08 2003 21:39 EDT
- in response to Jon Martin Solaas
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! -
work is not all[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 09 2003 00:31 EDT
- in response to Jon Martin Solaas
"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 todays 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 -
work is not all[ Go to top ]
- Posted by: Jason McKerr
- Posted on: May 09 2003 01:14 EDT
- in response to Jon Martin Solaas
AAAAAAAAH!!!!!
THE FIRE ENGINE IS RED! -
work is not all[ Go to top ]
- Posted by: Jason McKerr
- Posted on: May 09 2003 01:16 EDT
- in response to Jon Martin Solaas
Cameron,
Sorry for the Troll, but I couldn't resist.
Jason -
work is not all[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 09 2003 09:05 EDT
- in response to Jon Martin Solaas
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! -
beauty is truth, truth is beauty[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 09 2003 19:15 EDT
- in response to Jon Martin Solaas
.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 Suns 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 -
beauty is truth, truth is beauty[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 09 2003 21:52 EDT
- in response to Jon Martin Solaas
It is a tale told by an idiot, full of sound and fury, yet signifying nothing? -
Cameron reads a book![ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 10 2003 02:37 EDT
- in response to Jon Martin Solaas
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!) -
what code..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 10 2003 05:47 EDT
- in response to Jon Martin Solaas
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 -
what code..[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 10 2003 08:48 EDT
- in response to Jon Martin Solaas
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! -
what code..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 10 2003 09:27 EDT
- in response to Jon Martin Solaas
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 -
what code..[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 10 2003 10:52 EDT
- in response to Jon Martin Solaas
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! -
digging in the wrong place[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 10 2003 13:00 EDT
- in response to Jon Martin Solaas
Ok,I found the thread,
First Edgar Sanchez gives this example, (https://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,
(https://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 (https://www.theserverside.com//home/thread.jsp?thread_id=16398#65673)
Thereafter you come with your apology, (https://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 -
digging in the wrong place[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 10 2003 18:50 EDT
- in response to Jon Martin Solaas
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! -
digging in the wrong place[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 10 2003 18:58 EDT
- in response to Jon Martin Solaas
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!!! -
strange results on Camerons computer..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 10 2003 23:38 EDT
- in response to Jon Martin Solaas
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 -
full disclosure[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 11 2003 13:34 EDT
- in response to Jon Martin Solaas
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! -
full disclosure[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 11 2003 14:39 EDT
- in response to Jon Martin Solaas
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 -
You didn't read ...[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 11 2003 17:36 EDT
- in response to Jon Martin Solaas
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! -
department of squirming excuses..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 11 2003 19:07 EDT
- in response to Jon Martin Solaas
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:
https://www.theserverside.com//home/thread.jsp?thread_id=16398#65656
In the meanwhile, - keep up your reading!
Regards
Rolf Tollerud -
department of squirming excuses..[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 12 2003 07:58 EDT
- in response to Jon Martin Solaas
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! -
worse and worse..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 12 2003 10:23 EDT
- in response to Jon Martin Solaas
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 -
worse and worse..[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 12 2003 11:59 EDT
- in response to Jon Martin Solaas
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! -
the rest is silence[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 12 2003 12:40 EDT
- in response to Jon Martin Solaas
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 -
the rest is silence[ Go to top ]
- Posted by: Jason McKerr
- Posted on: May 12 2003 12:54 EDT
- in response to Jon Martin Solaas
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 -
desperate?[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 12 2003 13:08 EDT
- in response to Jon Martin Solaas
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! -
made by a committee..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 12 2003 13:54 EDT
- in response to Jon Martin Solaas
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 -
made by a committee..[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 12 2003 14:03 EDT
- in response to Jon Martin Solaas
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! -
I beat Cameron![ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 13 2003 02:10 EDT
- in response to Jon Martin Solaas
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 -
tragic[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 13 2003 08:21 EDT
- in response to Jon Martin Solaas
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! -
tragic, in spite of Camerons hopeless Don Quixote efforts[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 14 2003 00:55 EDT
- in response to Jon Martin Solaas
Hi Cameron,
It seems that the original thread is not finished yet!
https://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 -
woe is me[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 14 2003 11:58 EDT
- in response to Jon Martin Solaas
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! -
why tragic?[ Go to top ]
- Posted by: Henrique Steckelberg
- Posted on: May 14 2003 13:01 EDT
- in response to Jon Martin Solaas
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. -
must to be careful with Cameron, he is not young anymore..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 14 2003 14:50 EDT
- in response to Jon Martin Solaas
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 -
don't try to change the subject[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 14 2003 15:53 EDT
- in response to Jon Martin Solaas
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! -
from the "loser"[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 14 2003 16:26 EDT
- in response to Jon Martin Solaas
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 -
one more time[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 14 2003 16:48 EDT
- in response to Jon Martin Solaas
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! -
from the "loser"[ Go to top ]
- Posted by: Jason McKerr
- Posted on: May 14 2003 17:40 EDT
- in response to Jon Martin Solaas
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 -
would you buy a used car from Cameron?[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 14 2003 18:52 EDT
- in response to Jon Martin Solaas
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 -
would you buy a used car from Cameron?[ Go to top ]
- Posted by: Jason McKerr
- Posted on: May 14 2003 18:58 EDT
- in response to Jon Martin Solaas
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 -
would you buy a used car from Cameron?[ Go to top ]
- Posted by: Jason McKerr
- Posted on: May 14 2003 19:35 EDT
- in response to Jon Martin Solaas
I should have said,
If you've ever written ANY JAVA application, not just J2EE.
Jason McKerr
Northwest Alliance for Computational Science and Engineering -
would you buy a used brain from Rolf?[ Go to top ]
- Posted by: Henrique Steckelberg
- Posted on: May 14 2003 20:41 EDT
- in response to Jon Martin Solaas
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. -
one more time[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 14 2003 23:28 EDT
- in response to Jon Martin Solaas
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 -
one more time[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 15 2003 08:25 EDT
- in response to Jon Martin Solaas
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. -
one last time[ Go to top ]
- Posted by: Henrique Steckelberg
- Posted on: May 15 2003 08:25 EDT
- in response to Jon Martin Solaas
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. -
one more time[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 15 2003 11:15 EDT
- in response to Jon Martin Solaas
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 -
one more time[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 15 2003 11:59 EDT
- in response to Jon Martin Solaas
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. -
so the discussion was not closed![ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 15 2003 12:36 EDT
- in response to Jon Martin Solaas
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 -
so the discussion was not closed![ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 15 2003 12:53 EDT
- in response to Jon Martin Solaas
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! -
java is faster on second run (with 64MB)[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 15 2003 14:05 EDT
- in response to Jon Martin Solaas
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 -
java is faster on second run (with 64MB)[ Go to top ]
- Posted by: Henrique Steckelberg
- Posted on: May 15 2003 16:00 EDT
- in response to Jon Martin Solaas
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. -
Java is apparently faster in general[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 16 2003 13:47 EDT
- in response to Jon Martin Solaas
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! -
here we go again[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 16 2003 14:34 EDT
- in response to Jon Martin Solaas
Sorry it should be,
java -server -Xms20m -Xmx20m ManyPeople -
here we go again[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 16 2003 14:35 EDT
- in response to Jon Martin Solaas
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 -
?[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 16 2003 14:35 EDT
- in response to Jon Martin Solaas
How could my second post come out before my first? -
post ordering[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 16 2003 14:46 EDT
- in response to Jon Martin Solaas
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! -
Silence[ Go to top ]
- Posted by: Elaine Brownson
- Posted on: May 16 2003 14:50 EDT
- in response to Jon Martin Solaas
And then, there was silence on the board.....
Well done. -
Nope[ Go to top ]
- Posted by: Elaine Brownson
- Posted on: May 16 2003 14:51 EDT
- in response to Jon Martin Solaas
I spoke too soon...... -
there we went again[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: May 16 2003 14:52 EDT
- in response to Jon Martin Solaas
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! -
finish for now..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 16 2003 15:31 EDT
- in response to Jon Martin Solaas
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 -
Off Topic... May[ Go to top ]
- Posted by: Rob Misek
- Posted on: May 16 2003 16:21 EDT
- in response to Jon Martin Solaas
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. -
Off Topic... May[ Go to top ]
- Posted by: Stefan Tilkov
- Posted on: May 16 2003 17:11 EDT
- in response to Jon Martin Solaas
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> -
Weird[ Go to top ]
- Posted by: Dimitri Rakitine
- Posted on: May 16 2003 17:26 EDT
- in response to Jon Martin Solaas
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
??? -
expertise..[ Go to top ]
- Posted by: Rolf Tollerud
- Posted on: May 16 2003 17:33 EDT
- in response to Jon Martin Solaas
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 -
Rolf's occupation[ Go to top ]
- Posted by: Nipsu
- Posted on: May 16 2003 17:45 EDT
- in response to Jon Martin Solaas
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. -
expertise..[ Go to top ]
- Posted by: Matthew Cox
- Posted on: May 16 2003 19:16 EDT
- in response to Jon Martin Solaas
Rolf I think you need to check into AA or something -
Re:Weird[ Go to top ]
- Posted by: Hun Boon Teo
- Posted on: May 17 2003 02:55 EDT
- in response to Jon Martin Solaas
<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 -
expertise..[ Go to top ]
- Posted by: Stefan Tilkov
- Posted on: May 17 2003 15:50 EDT
- in response to Jon Martin Solaas
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 -
Re:Weird[ Go to top ]
- Posted by: Dimitri Rakitine
- Posted on: May 17 2003 23:12 EDT
- in response to Jon Martin Solaas
Aha. Thanks for the explanation. -
digging in the wrong place[ Go to top ]
- Posted by: kabal
- Posted on: May 18 2003 14:41 EDT
- in response to Jon Martin Solaas
Ok,I found the thread,
>
> First Edgar Sanchez gives this example, (https://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,
> (https://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 (https://www.theserverside.com//home/thread.jsp?thread_id=16398#65673)
>
> Thereafter you come with your apology, (https://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