473,503 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

benchmarks? java vs .net

The shootout site has benchmarks comparing different languages. It
includes C# Mono vs Java but not C# .NET vs Java. So I went through
all the benchmark on the site ...

http://kingrazi.blogspot.com/2008/05...enchmarks.html

Just to keep the post on topic for my friends at comp.lang.c++, how do
I play default windows sounds with C++?

Jun 27 '08
318 10735
On Mon, 9 Jun 2008 06:44:26 -0700 (PDT), "Jon Skeet [C# MVP]"
<sk***@pobox.comwrote:
>But the point is that it didn't fail for n=20, which is the test in
question.
Even with n=16, GC runs with my tweak of -Xms512m etc. Harpo is lying.
He now has zero credibility.
Jun 27 '08 #301
Razii wrote:
On Mon, 09 Jun 2008 14:17:13 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
>>Firstly, your tweak did not break the program for other (previously valid)
inputs as Razii's does.

Have some decency and don't lie. My tweak doesn't break the program
for any previously valid input.
The program used to work for n=22 on my machine. With your tweak it no
longer works for n=22 because it runs out of heap space.

So you broke the program for previously valid input.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #302
On Mon, 09 Jun 2008 16:56:48 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
>I cranked up the heap until the GC never ran. Surely we can agree that the
GC was effectively off when it never even ran?!
GC never runs if you enter n=7, even without any command-line
arguments. You are a fool. Just because GC doesn't need to run
doesn't mean it's off. When the memory is full, GC will run...
Jun 27 '08 #303
On Mon, 09 Jun 2008 16:56:48 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
On a different machine with a different VM the exact same
test might very well fail.
It won't fail. You have posted ZERO evidence that the test fails ony
any machine.

Jun 27 '08 #304
On Mon, 09 Jun 2008 16:56:48 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
>In contrast, I have posted numerous reproducible counter examples
demonstrating the GC never being invoked.
You have posted no such thing other than making a fool out of yourself
in public.
Jun 27 '08 #305
On Tue, 10 Jun 2008 01:18:40 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
>The program used to work for n=22 on my machine. With your tweak it no
longer works for n=22 because it runs out of heap space.
The program works fine with n=22 with my options. Nothing is "broken."

java -server -Xms512m -Xmx512m -XX:NewRatio=1 binarytrees 22
stretch tree of depth 23 check: -1
8388608 trees of depth 4 check: -8388608
2097152 trees of depth 6 check: -2097152
524288 trees of depth 8 check: -524288
131072 trees of depth 10 check: -131072
32768 trees of depth 12 check: -32768
8192 trees of depth 14 check: -8192
2048 trees of depth 16 check: -2048
512 trees of depth 18 check: -512
128 trees of depth 20 check: -128
32 trees of depth 22 check: -32
long lived tree of depth 22 check: -1

real 7m0.076s

In fact, the with n=22, the better argumenst are:

Jun 27 '08 #306
On Mon, 09 Jun 2008 20:07:46 -0500, Razii <py******@gmail.comwrote:
>On Mon, 9 Jun 2008 17:56:43 -0700 (PDT), kwikius
<an**@servocomm.freeserve.co.ukwrote:
>>
regards
Andy Little
*PLONK*

The nut has gotten more attention than he deserves (given he has
nothing interesting to say anyway).
Jun 27 '08 #307
On Mon, 09 Jun 2008 20:07:04 -0500, Razii <py******@gmail.comwrote:
>In fact, the with n=22, the better argumenst are:
$ time java -server -Xms1600m -Xmx1600m -XX:NewRatio=1 binarytrees 22
stretch tree of depth 23 check: -1
8388608 trees of depth 4 check: -8388608
2097152 trees of depth 6 check: -2097152
524288 trees of depth 8 check: -524288
131072 trees of depth 10 check: -131072
32768 trees of depth 12 check: -32768
8192 trees of depth 14 check: -8192
2048 trees of depth 16 check: -2048
512 trees of depth 18 check: -512
128 trees of depth 20 check: -128
32 trees of depth 22 check: -32
long lived tree of depth 22 check: -1

real 1m17.265s

in any case, nothing is "broken."
Jun 27 '08 #308
On Jun 10, 2:19*am, Razii <pyukj...@gmail.comwrote:
On Mon, 09 Jun 2008 20:07:04 -0500, Razii <pyukj...@gmail.comwrote:
In fact, the with n=22, the better argumenst are:

$ time java -server *
And your C++ question is?

regards
Andy Little
Jun 27 '08 #309
Razii wrote:
On Tue, 10 Jun 2008 01:18:40 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
>>The program used to work for n=22 on my machine. With your tweak it no
longer works for n=22 because it runs out of heap space.

The program works fine with n=22 with my options. Nothing is "broken."
Your program is broken:

$ time java -server -Xms512m -Xmx512m -XX:NewRatio=1 binarytrees 22
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :58)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.access$000(binarytrees.java:3 9)
at binarytrees.main(binarytrees.java:19)

real 0m34.124s
user 0m24.458s
sys 0m3.112s

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #310
Razii wrote:
On Mon, 09 Jun 2008 16:56:48 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
>On a different machine with a different VM the exact same
test might very well fail.

It won't fail. You have posted ZERO evidence that the test fails ony
any machine.
Here is your program failing on my machine (again) where others succeeded:

$ time java -server -Xms512m -Xmx512m -XX:NewRatio=1 binarytrees 22
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :58)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.bottomUpTree(binarytrees.java :51)
at binarytrees$TreeNode.access$000(binarytrees.java:3 9)
at binarytrees.main(binarytrees.java:19)

real 0m34.124s
user 0m24.458s
sys 0m3.112s

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #311
On Tue, 10 Jun 2008 02:51:01 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
>Your program is broken:
It isn't "broken" on mine as I showed. If on your computer it doesn't
run, increase the heap-size. Nothing is "broken." C# has access to the
entire ram (and it uses over 700 MB with n=22).

Jun 27 '08 #312
On Tue, 10 Jun 2008 02:53:16 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
>Here is your program failing on my machine (again) where others succeeded:
Since you have posted other claims that were not reproducible, I will
take this claim with a grain of slat unless someone else verifies it.
The program works fine on my computer.

Second, C# has access to entire RAM. Increase Xmx and Xms to 1600m
and java version again is faster

$ time binarytrees 22 (C#)
stretch tree of depth 23 check: -1
8388608 trees of depth 4 check: -8388608
2097152 trees of depth 6 check: -2097152
524288 trees of depth 8 check: -524288
131072 trees of depth 10 check: -131072
32768 trees of depth 12 check: -32768
8192 trees of depth 14 check: -8192
2048 trees of depth 16 check: -2048
512 trees of depth 18 check: -512
128 trees of depth 20 check: -128
32 trees of depth 22 check: -32
long lived tree of depth 22 check: -1

real 2m6.072s
$ time java -server -Xms1600m -Xmx1600m -XX:NewRatio=1 binarytrees 22
stretch tree of depth 23 check: -1
8388608 trees of depth 4 check: -8388608
2097152 trees of depth 6 check: -2097152
524288 trees of depth 8 check: -524288
131072 trees of depth 10 check: -131072
32768 trees of depth 12 check: -32768
8192 trees of depth 14 check: -8192
2048 trees of depth 16 check: -2048
512 trees of depth 18 check: -512
128 trees of depth 20 check: -128
32 trees of depth 22 check: -32
long lived tree of depth 22 check: -1

real 1m22.414s
Jun 27 '08 #313
Rudy Velthuis wrote:
Arne Vajhøj wrote:
>>IOW, there are arguments for both approaches. The GC one has the big
advantage that one big cause of errors, all errors regarding memory
use, are more or less completely eliminated. But I doubt I would
call speed one of the main factors to choose a GC.
Actually GC speed is very good.

The problem people complain over is the non deterministic
aspect of it.

People also complained about messaging and the non-linear aspect of it
when they moved from DOS to Windows. I guess, to many, this is a
similar issue, i.e. they sense a loss of control. <g>
That is most certainly something that causes a lot of C++ programmers
going to Java or C# to feel uncomfortable.

Arne
Jun 27 '08 #314
Jon Harrop wrote:
Arne Vajhøj wrote:
>Jon Harrop wrote:
>>Razii wrote:
On Wed, 04 Jun 2008 20:34:59 +0100, Jon Harrop <jo*@ffconsultancy.com>
wrote:
You are still timing Cygwin's implementation of Unix pipes which has
nothing to do with anything.
I am still waiting for you to verify and demonstrate it has any
effect.
Your inexplicably anomalous results already proved that.
For anyone with just a minimum of understanding of logic: not.

My Cygwin-free results are up to 4x faster than Razii's Cygwin-burdened
results. How else do you explain that?
May I suggest you enroll in a university where they teach science.

The fact that you can not find another explanation does
not prove anything.

Arne
Jun 27 '08 #315
Jon Harrop wrote:
Arne Vajhøj wrote:
>Or why do you think the Cygwin stuff can explain the difference in the two
tests?

According to Razii, Cygwin is the only significant difference between our
setups. From my results, we know Razii's results for .NET are up to 4x
slower than they should be. Therefore, Cygwin is the only logical
explanation.
And you think that Cygwin slows down .NET x4 but not Java ?

It is possible. But I find it very likely that there is another
explanation.

And if you want to know why, then try and write a time utility
(in any language) that shows that behavior.

Arne
Jun 27 '08 #316
Jon Harrop wrote:
Arne Vajhøj wrote:
>Jon Harrop wrote:
>>You are ignoring all of the overheads of a GC, like thread
synchronization, stack walking and limitations placed upon the code
generator required to keep the GC happy.
I would expect non-GC solutions to need more thread synchronization
than GC because it will need it many more times.

That is just more unfounded speculation.
Since it contains an argument then you can hardly call it unfounded.

Arne
Jun 27 '08 #317
Arne Vajhøj wrote:
Jon Harrop wrote:
>Arne Vajhøj wrote:
>>Jon Harrop wrote:
You are ignoring all of the overheads of a GC, like thread
synchronization, stack walking and limitations placed upon the code
generator required to keep the GC happy.

I would expect non-GC solutions to need more thread synchronization
than GC because it will need it many more times.

That is just more unfounded speculation.

Since it contains an argument then you can hardly call it unfounded.
If you want to argue that point then you need to explain why you believe
that GC'd programs do less thread synchronization.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #318
Arne Vajhøj wrote:
May I suggest you enroll in a university where they teach science.
http://www.ffconsultancy.com/free/thesis.html
The fact that you can not find another explanation does not prove
anything.
We eventually found an alternative explanation: Razii had been lying about
his results. He had never even managed to compile the optimized .NET
programs I provided, let alone benchmark them.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #319

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

80
3447
by: tech | last post by:
Hi, i have the following problem In file1.h namespace A { class Bar { void foo();
358
12873
by: King Raz | last post by:
The shootout site has benchmarks comparing different languages. It includes C# Mono vs Java but not C# .NET vs Java. So I went through all the benchmark on the site ... ...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.