473,883 Members | 1,576 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 13276
On Wed, 04 Jun 2008 21:01:56 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>>>revcomp:
C#: 1.2s
Java: 1.5s

Post the link to the code.

That was C# directly from the shootout.
Earlier you said that revcomp was slower and you need to look at it.
How did it become faster if it's directly from the site? If you added
a buffer, keep in mind the rule is that you can't read more than 82
bytes/chars at a time. If you made the buffer larger than that, then
change this line

byte[] line = new byte[82]

to something like byte[] line = new byte[18432]


Jun 27 '08 #181
Razii wrote:
On Wed, 04 Jun 2008 21:01:56 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>>Actually I don't need to because the existing F# code is already fast:

F#: 2.7s
Java: 2.4s

Did you use -server -Xms64m flag?
Yes.
.NET is twice slower.
No.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #182
Razii wrote:
On Wed, 04 Jun 2008 21:01:56 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>>>>revcomp:
C#: 1.2s
Java: 1.5s

Post the link to the code.

That was C# directly from the shootout.

Earlier you said that revcomp was slower and you need to look at it.
That is not true.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #183
Razii wrote:
C# is twice slower.
Use F#.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #184
Jon Skeet [C# MVP] wrote:
Razii <ni****@mail.co mwrote:
>What about binarytrees?

http://shootout.alioth.debian.org/gp...ng=csharp&id=0
>>
http://shootout.alioth.debian.org/gp...ng=javaxx&id=2
>
I haven't looked at it yet...
There is no significant performance difference between the F# and Java.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #185
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. Also, in this case, you did
say several times that .NET is slower, but the benchmark is flawed.
You just changed your claim suddenly.
Jun 27 '08 #186
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.
Jun 27 '08 #187
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.
Jun 27 '08 #188
Razii <ni*********@ma il.comwrote:
On Wed, 4 Jun 2008 23:25:27 +0100, Jon Skeet [C# MVP]
<sk***@pobox.co mwrote:
That's changing the Java code. Now what about the C# code - and is that
with the big file, or the original benchmark way of creating thousands
of processes?

The original benchmark uses this file

http://shootout.alioth.debian.org/do...mcol-input.txt

made 21,000 times bigger. Basically, concatenate the above file 21,000
times, and you have the same file that I and shootout site do.

As for C# using file, post the changes.
I did, early yesterday evening. I posted both a Java *and* a C# program
which allowed you to either pipe input to the program *or* provide a
filename.

I also posted the results of running said code - C# was slower than
Java when reading from stdin (at the time using Console.In - using
OpenStandardInp ut narrows the gap) and about the same as Java when
reading directly from a file.

--
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 #189
Jon Harrop <jo*@ffconsulta ncy.comwrote:
Jon Skeet [C# MVP] wrote:
Mark Thornton <mt*******@optr ak.co.ukwrote:
(Another nail in the coffin of the claim that ".NET is twice as slow as
Java" though,
I don't see much in these benchmarks of the sort of code where the more
mature HotSpot JIT could be expected to outshine .NET.
Indeed. As I said before, it's pretty easy to construct code where Java
*does* outperform C#:
...
As it is, Java outperforms .NET...

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.

--
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 #190

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
9936
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
10412
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
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
7123
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.