473,654 Members | 3,114 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 10952

On Tue, 03 Jun 2008 19:37:57 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>But still 2x slower than everything else and now 2x more bloated as well:
The FastMath class can be separated and used instead of java's Math in
all cases. The bloat is ZERO.
Jun 27 '08 #51
Razii wrote:
On Tue, 03 Jun 2008 19:48:16 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>>Yes. Mono is extremely slow. Almost as slow as Java on this benchmark. As
we have seen, .NET is much faster...

That was a typo. I don't have Mono. I get that with .NET.
Java is 2x slower than .NET on my AMD64 for this benchmark. What CPU are you
using?

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #52
Razii wrote:
On Tue, 03 Jun 2008 19:37:57 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>>But still 2x slower than everything else and now 2x more bloated as well:

The FastMath class can be separated and used instead of java's Math in
all cases. The bloat is ZERO.
So having to write your own basic trig functions in Java so that you can be
only 2x slower than other languages doesn't bother you?

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #53
Razii <kl*****@mail.c omwrote:
That was the link you posted *initially*. Since then you have posted
multiple links to http://shootout.alioth.debian.org which is about
Mono.

Huh? I will be polite for now and just say you didn't read the thread
carefully. The benchmark I tested are at that site. I don't have Mono.
I only have .NET.
Let's look at the most recent set of links you posted to "prove" that
Java is faster than C#:

http://shootout.alioth.debian.org/gp...benchmark.php?
test=binarytree s&lang=javaxx&i d=2

http://shootout.alioth.debian.org/gp...benchmark.php?
test=binarytree s&lang=csharp&i d=0
revcomp
http://shootout.alioth.debian.org/gp...benchmark.php?
test=revcomp&la ng=javaxx&id=4
vs
http://shootout.alioth.debian.org/gp...benchmark.php?
test=revcomp&la ng=csharp&id=2
sumcol
http://shootout.alioth.debian.org/gp...benchmark.php?
test=sumcol&lan g=javaxx&id=4
vs
http://shootout.alioth.debian.org/gp...benchmark.php?
test=sumcol&lan g=csharp&id=0

http://shootout.alioth.debian.org/gp...benchmark.php?
test=recursive& lang=javaxx&id= 0
vs
http://shootout.alioth.debian.org/gp...benchmark.php?
test=recursive& lang=csharp&id= 0
Now, you're using *those results* to form conclusions, right? If not,
there was little point in posting them. However, those results are of
Mono, not .NET.

This is why I've urged consistency. What's the point in debating Java
vs .NET if you keep posting links to results of Java vs Mono?

--
Jon Skeet - <sk***@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #54
On Tue, 3 Jun 2008 20:27:19 +0100, Jon Skeet [C# MVP]
<sk***@pobox.co mwrote:
>That looks very much like Unix output rather than Windows. Are you
running under cygwin or something similar?
Yes, I am running cygwin.
Jun 27 '08 #55
On Tue, 03 Jun 2008 20:03:49 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>You said ".NET is twice slower in four benchmarks: binarytrees, mandelbrot,
regexdna, sumcol.". I have already corrected two of your results (mandelbrot
and regexdna) and provided two more counter examples where .NET is >2x
faster than Java and explained why binarytrees is flawed.
Yes, you did correct two of them. I added recursive to the list, so
there are 3 more to go.

With FastMath, C# is not much faster in partialsums on my computer.
You haven't posted the other prime benchmark yet so I can't comment on
that.

Jun 27 '08 #56
On Tue, 3 Jun 2008 20:23:08 +0100, Jon Skeet [C# MVP]
<sk***@pobox.co mwrote:
>The mandelbrot one. Look back in the thread from where I first talked
about IO, and you'll see it's the last one referenced.
Yes, that was fixed by Harpo a while ago.
>Which benchmark are you talking about now? sum-file uses BufferedReader
but not StreamTokenizer as far as I can see.
I suspect System.in is already buffered by default.
>1) File IO
2) Conversion from binary to text
3) Splitting a stream of textual data into lines
4) Parsing text into integers
5) Integer addition
6) Writing the result to the console
(1), (2), (4), (5), (6) ?
Jun 27 '08 #57
Razii <kl*****@mail.c omwrote:
That looks very much like Unix output rather than Windows. Are you
running under cygwin or something similar?

Yes, I am running cygwin.
Has it occurred to you that that may have an effect on the results?

The benchmarks would be *much* better in my view if each benchmark
started up a single process and ran with it for a significant amount of
time. After all, that's far more realistic in terms of how almost all
software is actually run in the real world.

--
Jon Skeet - <sk***@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #58
Razii <kl*****@mail.c omwrote:
The mandelbrot one. Look back in the thread from where I first talked
about IO, and you'll see it's the last one referenced.

Yes, that was fixed by Harpo a while ago.
And yet you seem to be completely ignoring my point: a shootout which
has had such a trivial but significant flaw for a significant time is
suspect in its methodology. (Heck, the measurement style is dodgy to
start with. Including the startup cost in the test is pretty crazy.)
Which benchmark are you talking about now? sum-file uses BufferedReader
but not StreamTokenizer as far as I can see.

I suspect System.in is already buffered by default.
In what way does your sentence relate to my two?
1) File IO
2) Conversion from binary to text
3) Splitting a stream of textual data into lines
4) Parsing text into integers
5) Integer addition
6) Writing the result to the console

(1), (2), (4), (5), (6) ?
What is your list of numbers meant to signify?

--
Jon Skeet - <sk***@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #59
Starting new thread, since that thread got too large (same applies to
C++).

On Tue, 03 Jun 2008 20:07:00 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>So having to write your own basic trig functions in Java so that you can be
only 2x slower than other languages doesn't bother you?
It's not 2x slower with my trig function on my computer.

On the other hand, C# results are not accurate for trig functions.

using System;
using System.IO;

class Test
{
static void Main(){
Console.WriteLi ne(Math.Sin (1e15));
}
}
The answer I get from C# is: 0.8582721324763 73

with Java I get 0.8582727931702 359

Checking the answer with maple, I get
0.8582727931702 358355238863908 484066466002034

How are you going to fix C# in this case?

Does it bother you that C# gave wrong answer?
Jun 27 '08 #60

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

Similar topics

80
3500
by: tech | last post by:
Hi, i have the following problem In file1.h namespace A { class Bar { void foo();
358
13052
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 ... http://kingrazi.blogspot.com/2008/05/shootout-c-net-vs-java-benchmarks.html Just to keep the post on topic for my friends at comp.lang.c++, how do I play default windows sounds with C++?
0
8379
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8596
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5627
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
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 we have to send another system
2
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.