473,915 Members | 7,703 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 13310
On Tue, 3 Jun 2008 19:37:47 +0100, Jon Skeet [C# MVP]
<sk***@pobox.co mwrote:
>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.


Jun 27 '08 #41
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 #42
Jon Harrop <jo*@ffconsulta ncy.comwrote:
Mark Thornton wrote:
Jon Skeet [C# MVP] wrote:
>Does Java have anything comparable to .NET's Task Parallel Library?

I haven't used it, but I've heard about Doug Lea's Fork/Join
framework:
http://gee.cs.oswego.edu/dl/papers/fj.pdf
I have used it and find it works quite well even without closures. I
haven't used .NET so can't compare them.

The Task Parallel Library is awesome, even though it is only a CTP for now.
Agreed. Now is a particularly good time to get into it, as the second
CTP has just been released:

http://blogs.msdn.com/pfxteam/archiv...2/8567093.aspx
I highly recommend it. For example, read the article:

"Surviving in the multicore era with Microsoft's ParallelFX" - The F#.NET
Journal, 30th April 2008
http://www.ffconsultancy.com/product...rp_journal/?cs
Or not, given that that's subscription only...

--
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 #43
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.
Jun 27 '08 #44
On Tue, 3 Jun 2008 19:50:21 +0100, Jon Skeet [C# MVP]
<sk***@pobox.co mwrote:
>Um, the C# version (as posted on the site you've linked to below) uses
unbuffered IO while the Java version doesn't. They're just not doing
the same thing.
What benchmark are you talking about? Changing the line to

using (StreamReader r = new StreamReader(ne w
BufferedStream( Console.OpenSta ndardInput())))

didn't make a difference in sum-file benchmark.

By the way, StreamTokenizer is not buffered. It reads a byte each time
from the stream. It maybe that System.in is buffered by default in
Java.

Jun 27 '08 #45

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 #46
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 #47
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 #48
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 #49
On Tue, 03 Jun 2008 20:05:33 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>Java is 2x slower than .NET on my AMD64 for this benchmark. What CPU are you
using?
AMD 3 core phenom

Are you sure you used this version?

http://shootout.alioth.debian.org/gp...lang=java&id=4

$ time partialsums 2500000 (.NET)
3.000000000 (2/3)^k
3160.817621887 k^-0.5
0.999999600 1/k(k+1)
30.314541510 Flint Hills
42.995233998 Cookson Hills
15.309017155 Harmonic
1.644933667 Riemann Zeta
0.693146981 Alternating Harmonic
0.785398063 Gregory

real 0m1.530s
user 0m0.000s
sys 0m0.031s

$ time java -server partialsums 2500000
3.000000000 (2/3)^k
3160.817621887 k^-0.5
0.999999600 1/k(k+1)
30.314541510 Flint Hills
42.995233998 Cookson Hills
15.309017155 Harmonic
1.644933667 Riemann Zeta
0.693146981 Alternating Harmonic
0.785398063 Gregory

real 0m1.697s
user 0m0.000s
sys 0m0.031s

Jun 27 '08 #50

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

Similar topics

80
3578
by: tech | last post by:
Hi, i have the following problem In file1.h namespace A { class Bar { void foo();
318
11215
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
10039
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
11359
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...
1
11069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10543
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
9734
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
8102
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
7259
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
5944
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
4779
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

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.