473,554 Members | 3,024 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 12937
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 #61
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 #62
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 #63
Jon Skeet [C# MVP] wrote:
Mark Thornton <mt*******@optr ak.co.ukwrote:

<snip>
>There are some FJ examples here:
http://artisans-serverintellect-com....efault.asp?W32

The recursive matrix multiplication is my contribution.

Right. It still looks a bit involved - which is only to be expected,
really. I haven't taken it in fully yet though - will aim to do so at a
later date. Might try porting to Parallel Extensions...
Frameworks like Fork/Join can only go so far in easing tasks like matrix
multiplication. Given that my Java code won't be making best use of
SSE, I was quite pleased with the performance of the result.

Mark Thornton
Jun 27 '08 #64
Razii wrote:
Is this guy Jon Skeet really this stupid?

Let me know so I can add him to ignore list.
Razii, if you hope to ever have any positive effect in your
communication - e.g. convince anyone that you have a clue - you'll have
to work much harder not to look like a naive 13 year old with
undeveloped social skills.

Plonk etc.

-- Barry

--
http://barrkel.blogspot.com/
Jun 27 '08 #65
Jon Skeet wrote:
Now using Parallel Extensions, and the lamdba expressions of C# 3:

public override void Generate()
{
Parallel.For(0, Height, row =>
{
int index = row * Width;
for (int col = 0; col < Width; col++)
{
Data[index++] = ComputeMandelbr otIndex(row, col);
}
});
}

I can't imagine many transformations being simpler than that - and the
results are great.
How have you found Parallel.For to perform?

I've found that my own naive (i.e. quick hack with little thought)
implementations of Parallel.For that dispatch over a fixed number of
threads (one thread per core) outperform the ones in the TPL by quite a
bit - TPL seemed to have had around ~20% overhead in the particular
microbenchmark I was trying to scale over my quad core.

I must dig it out and analyse the discrepancy, and blog about it, when I
find time.

-- Barry

--
http://barrkel.blogspot.com/
Jun 27 '08 #66
On Tue, 03 Jun 2008 22:27:12 +0100, Barry Kelly
<ba***********@ gmail.comwrote:
>Plonk etc.
You must be a newbie, moron. No one ever plonks me. You can try
though, as you did.

As for Jon Skeet, what kind of reply do you expect? I explained to him
that I don't have Mono, and the benchmarks I am using are at shootout
site (not that I myself am using Mono). The link to the blog I posted
also makes that clear, but yet the guy continued with the same line
that I am comparing Mono. Is he stupid or just doesn't take the time
to read carefully? Take your pick.
Jun 27 '08 #67
Barry Kelly <ba***********@ gmail.comwrote:
I can't imagine many transformations being simpler than that - and the
results are great.

How have you found Parallel.For to perform?
Very well - see my last few blog posts.
I've found that my own naive (i.e. quick hack with little thought)
implementations of Parallel.For that dispatch over a fixed number of
threads (one thread per core) outperform the ones in the TPL by quite a
bit - TPL seemed to have had around ~20% overhead in the particular
microbenchmark I was trying to scale over my quad core.

I must dig it out and analyse the discrepancy, and blog about it, when I
find time.
I wouldn't be surprised if some individual test cases did badly in
microbenchmarks . Without even looking at your code, my guess is that
you may find your code doesn't work as well when there's other load on
the processor (e.g. effectively taking up one core with a different
process) whereas work stealing should (I believe) cope with that
reasonably well.

But as I point out on the most recent blog entry, accurately
benchmarking this kind of thing and being able to interpret the results
sensibly is basically beyond my current understanding (and time to
spend on it).

--
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 #68
On Tue, 3 Jun 2008 21:04:47 +0100, Jon Skeet [C# MVP]
<sk***@pobox.co mwrote:
>Has it occurred to you that that may have an effect on the results?
No, it won't have a major effect.

Jun 27 '08 #69
On Tue, 03 Jun 2008 15:14:52 -0500, Razii <kl*****@mail.c omwrote:
>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.858272793170 235835523886390 848406646600203 4

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

Does it bother you that C# gave wrong answer?
Console.WriteLi ne(Math.Sin (1e7));

0.4205477931907 71 (C# with .NET)
0.4205477931907 824912985065897 4095 (right answer)

Console.WriteLi ne(Math.Sin (1e10));

-0.4875060250762 7 (C# with .NET)
-0.4875060250875 106915277942943 4811 (right answer)

Console.WriteLi ne(Math.Sin (1e15));

0.8582721324763 73 (C# with .NET)
0.8582727931702 358355238863908 484 (right answer)

So C# doesn't get 15-17 digit accuracy of double for sin and cos.
That's the only reason it's faster in partialsums benchmark. By using
FastMath class, the times for both is about same on my computer.

On the other hand, you still need to 'optimize' 4 benchmarks where
..NET is much slower: binarytrees, sum-col, recursive, revcomp.
Jun 27 '08 #70

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

Similar topics

80
3476
by: tech | last post by:
Hi, i have the following problem In file1.h namespace A { class Bar { void foo();
318
10828
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...
0
7584
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...
0
7512
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...
0
7783
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. ...
1
7547
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...
0
7879
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...
0
6129
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...
1
5426
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...
1
2009
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
0
828
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...

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.