473,883 Members | 1,651 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
358 13269
Razii <ni*******@mail .comwrote:

<snip>
So we are done with this partialsums benchmark; this was the only case
where C# was significantly faster.
And I for one have never been claiming that .NET or C# is significantly
faster than Java overall. (If any benchmarks made custom calls to
native code, that would be interesting. I really have no idea how JNI
compares with P/Invoke in terms of speed. I know which is more pleasant
to use, mind you :)

Given how similar their overall approach is, and how both of them have
had a lot of time and money spent optimising their VMs (with more work
to be done, for sure) it's unsurprising that they're pretty much a tie.

My conclusion: don't choose between Java and .NET on performance
grounds. There are far better reasons to choose one or the other,
depending on other criteria.

--
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 #191
Razii wrote:
So we are done with this partialsums benchmark; this was the only case
where C# was significantly faster.
And Mersenne Twister, where F# is also 2x faster than Java.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #192
Razii wrote:
On Thu, 05 Jun 2008 01:53:41 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote
>>.NET is twice slower.

No.

It is twice slower on my computer, and, in this case, since there is
no input-file, Cygwin is invalid excuse.
This benchmark (revcomp) is completely IO bound and running it within Cygwin
with emulated Unix pipes will certainly affect performance.
Also, in this case, you did say several times that .NET is slower, but the
benchmark is flawed. You just changed your claim suddenly.
..NET is 13% slower not 2x slower.

I think we have been over the same thing enough times now. There is no
longer any evidence that Java is significantly faster. There are now no
benchmarks where Java is even 2x faster than .NET. All you had to do was
optimize the .NET code and run it properly (without emulation).

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #193
Razii wrote:
On Thu, 05 Jun 2008 01:56:10 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>>C# is twice slower.

Use F#.

You haven't posted anything for me to comment.
The fast .NET code is already on the shootout site (again).

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #194
Razii wrote:
On Thu, 05 Jun 2008 01:57:11 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>>There is no significant performance difference between the F# and Java.

Post the code and tell me how to compile.
Again, the fast .NET code (and compilation instructions) are already on the
shootout site. There is nothing for me to do (except tell you the same
thing over and over).

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #195
Jon Skeet [C# MVP] wrote:
Jon Harrop <jo*@ffconsulta ncy.comwrote:
>That is Java outperforming C#, not .NET.

No, it's Java outperforming .NET calling a virtual method. It has
nothing to do with the code that the IL is generated in: if you have a
virtual method which isn't overridden, the .NET CLR will not inline
calls to it. The Hotspot VM will inline it until it first sees the
method being overridden. The difference here is in the jitting model,
not in the language.

Try it in F#, ensuring that the method is virtual and actually called
each time (consider that the method might be one which has side-
effects). I can't see how it would possibly have a different result.
This optimization can obviously be done statically by the compiler. There is
no assurance that F# will also fail to optimize this, particularly if you
write a functional equivalent:

let iters = 1000000000

let main f =
let mutable sum = 0
for i=0 to iters-1 do
sum <- sum + f()

do
time main (fun () -1)

If F# does fail to optimize it, mark "main" as "inline".

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #196
On Thu, 05 Jun 2008 10:58:53 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>The fast .NET code is already on the shootout site (again).
I tested it and it's slowest.

Jun 27 '08 #197
On Thu, 05 Jun 2008 10:58:10 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>This benchmark (revcomp) is completely IO bound and running it within Cygwin
with emulated Unix pipes will certainly affect performance.
I tested it and there is no difference in timing. Also, the "emulated
Unix pipes" is the same for both side.

Jun 27 '08 #198
On Thu, 05 Jun 2008 10:54:33 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>And Mersenne Twister, where F# is also 2x faster than Java.
It's empty claim since we have no chance to look at the code. The link
you gave was broken.

I wonder why Harpo doesn't post the link? Perhaps he knows the claim
will be debunked if we have a chance to optimize?
Jun 27 '08 #199
On Thu, 5 Jun 2008 06:22:50 +0100, Jon Skeet [C# MVP]
<sk***@pobox.co mwrote:
>And I for one have never been claiming that .NET or C# is significantly
faster than Java overall. (If any benchmarks made custom calls to
native code, that would be interesting. I really have no idea how JNI
compares with P/Invoke in terms of speed. I know which is more pleasant
to use, mind you :)
This benchmark uses JNI to call libGMP

http://shootout.alioth.debian.org/gp...igits&lang=all

Jun 27 '08 #200

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

Similar topics

80
3572
by: tech | last post by:
Hi, i have the following problem In file1.h namespace A { class Bar { void foo();
318
11198
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
9935
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
11137
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
10742
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
9571
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7970
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7122
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
5797
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4609
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
3
3231
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.