473,883 Members | 1,725 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
On Mon, 09 Jun 2008 20:07:46 -0500, Razii <py******@gmail .comwrote:
>On Mon, 9 Jun 2008 17:56:43 -0700 (PDT), kwikius
<an**@servocom m.freeserve.co. ukwrote:
>>
regards
Andy Little
*PLONK*

The nut has gotten more attention than he deserves (given he has
nothing interesting to say anyway).
Jun 27 '08 #331
On Mon, 09 Jun 2008 20:07:04 -0500, Razii <py******@gmail .comwrote:
>In fact, the with n=22, the better argumenst are:
$ time java -server -Xms1600m -Xmx1600m -XX:NewRatio=1 binarytrees 22
stretch tree of depth 23 check: -1
8388608 trees of depth 4 check: -8388608
2097152 trees of depth 6 check: -2097152
524288 trees of depth 8 check: -524288
131072 trees of depth 10 check: -131072
32768 trees of depth 12 check: -32768
8192 trees of depth 14 check: -8192
2048 trees of depth 16 check: -2048
512 trees of depth 18 check: -512
128 trees of depth 20 check: -128
32 trees of depth 22 check: -32
long lived tree of depth 22 check: -1

real 1m17.265s

in any case, nothing is "broken."
Jun 27 '08 #332
On Jun 10, 2:07*am, Razii <pyukj...@gmail .comwrote:
On Mon, 9 Jun 2008 17:56:43 -0700 (PDT), kwikius

<a...@servocomm .freeserve.co.u kwrote:
regards
Andy Little

PLONK
Forgot to stick your follow ups back on that one didnt ya?

You stupid little twat.

regards
Andy Little
Jun 27 '08 #333
Razii wrote:
On Tue, 10 Jun 2008 02:59:42 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>>So .NET is 25% faster than Java here as well.

.NET is 25% slower on regexdna and Harpo admitted it last time in the
other thread. Note that now Harpo has changed his tune and is claiming
that .NET is faster in regexdna.
Here is my optimized F# solution that is 25% faster than the fastest Java
solution:

#light

#I @"C:\Program Files\Reference Assemblies\Micr osoft\Framework \v3.5"
#r @"C:\Program Files\Microsoft Parallel Extensions Jun08
CTP\System.Thre ading.dll"

open System.Text.Reg ularExpressions

let variants = ["agggtaaa|tttac cct"; "[cgt]gggtaaa|tttaccc[acg]";
"a[act]ggtaaa|tttacc[agt]t"; "ag[act]gtaaa|tttac[agt]ct";
"agg[act]taaa|ttta[agt]cct"; "aggg[acg]aaa|ttt[cgt]ccct";
"agggt[cgt]aa|tt[acg]accct"; "agggta[cgt]a|t[acg]taccct";
"agggtaa[cgt]|[acg]ttaccct"]

let subst = ["B", "(c|g|t)"; "D", "(a|g|t)"; "H", "(a|c|t)"; "K", "(g|t)";
"M", "(a|c)"; "N", "(a|c|g|t)" ; "R", "(a|g)"; "S", "(c|g)";
"V", "(a|c|g)"; "W", "(a|t)"; "Y", "(c|t)"]

let file_data =
use stream = System.Console. OpenStandardInp ut()
use stream = new System.IO.Buffe redStream(strea m)
use stream = new System.IO.Strea mReader(stream)
stream.ReadToEn d()

let file_length = String.length file_data

let dna = Regex(">.*\n|\n ", RegexOptions.Co mpiled).Replace (file_data, "")
let code_length = String.length dna

let () =
let futures =
[ for re in variants ->
System.Threadin g.Tasks.Future. Create(fun () ->
let mutable count = 0
let r = new Regex(re, RegexOptions.Co mpiled);
let mutable m = r.Match(dna)
while m.Success do
count <- count + 1
m <- m.NextMatch()
re, count) ]
for future in futures do
let re, count = future.Value
printf "%s %i\n" re count
let mutable b = dna
for re, s in subst do
b <- Regex(re, RegexOptions.Co mpiled).Replace (b, s)
printf "\n%i\n%i\n%i\n " file_length code_length (String.length b)

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #334
Razii wrote:
Later he changed his claim and started claiming .NET is faster.
You tweaked Java's GC parameters so Jon Skeet tweaked .NET's GC parameters
and we all got different results.
F# is slower than C# on .NET.
You are doing something wrong to make the F# run so slowly (given that it
runs much faster on my much slower machine).

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #335
Razii wrote:
On Tue, 10 Jun 2008 03:22:02 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>>So the F# solution is not only as fast as Java but it doesn't need to be
changed every time you alter the input. I think we have a clear winner...

F# not as "fast" as java. It's slower than C#, forget Java.
Then you are doing something wrong. What versions of the benchmark source
code, F#, .NET and the TPL are you using and what is your compile line?

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
Jun 27 '08 #336
On Tue, 10 Jun 2008 03:30:09 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>Your F# results are much slower than mine even though your machine is
faster. That proves you are doing something wrong when running the F#.
I am doing nothing wrong. My C# results are same as John Skeet and F#
(that is also running on .NET like C#) was only 2 seconds slower than
C#.
Jun 27 '08 #337
On Tue, 10 Jun 2008 03:41:19 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>Then you are doing something wrong. What versions of the benchmark source
code, F#, .NET and the TPL are you using and what is your compile line?
F# 1.9.4.17 http://research.microsoft.com/fsharp/release.aspx

fsc -O3 binarytreesf.fs

binarytreesf.fs (23,30): warning FS0062: This construct is for
compatibility with
OCaml. The expression form 'expr.(expr)' is for use when OCaml
compatibility is
enabled. In F# code you may use 'expr.[expr]'. A type annotation may
be require
d to indicate the first expression is an array. This warning can be
disabled usi
ng '--ml-compatibility', '--no-warn 62' or '#nowarn "62"'

binarytreesf.fs (23,16): warning FS0062: This construct is for
compatibility with
OCaml. Consider using the overloaded operator 'int' instead. This
warning can b
e disabled using '--ml-compatibility', '--no-warn 62' or '#nowarn
"62"'


Jun 27 '08 #338
On Tue, 10 Jun 2008 03:35:18 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>Here is my optimized F# solution that is 25% faster than the fastest Java
solution:
This doesn't compile

fsc -O3 regexdnaf.fs

regexdnaf.fs(4, 0): error FS0191: Unable to find the file C:\Program
Files\Micros
oft Parallel Extensions Jun08
CTP\System.Thre ading.dll in any of
C:\Windows\Micr osoft.NET\Frame work\v2.0.50727 \
C:\Program Files\Reference Assemblies\Micr osoft\Framework \v3.5
C:\MyApps\shoot out\Agressive
C:\Program Files\FSharp-1.9.4.17\bin.

Unlike yours, C# compiled fine...

csc regexdna.cs
Microsoft (R) Visual C# 2008 Compiler version 3.5.21022.8
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
$ time regexdna < reg3.txt
agggtaaa|tttacc ct 178
[cgt]gggtaaa|tttaccc[acg] 624
a[act]ggtaaa|tttacc[agt]t 2120
ag[act]gtaaa|tttac[agt]ct 1444
agg[act]taaa|ttta[agt]cct 2723
aggg[acg]aaa|ttt[cgt]ccct 767
agggt[cgt]aa|tt[acg]accct 713
agggta[cgt]a|t[acg]taccct 805
agggtaa[cgt]|[acg]ttaccct 1086

25416745
25000000
33399408

real 0m25.642s
user 0m0.030s
sys 0m0.015s

$ time java -server regexdna < reg3.txt
agggtaaa|tttacc ct 178
[cgt]gggtaaa|tttaccc[acg] 624
a[act]ggtaaa|tttacc[agt]t 2120
ag[act]gtaaa|tttac[agt]ct 1444
agg[act]taaa|ttta[agt]cct 2723
aggg[acg]aaa|ttt[cgt]ccct 767
agggt[cgt]aa|tt[acg]accct 713
agggta[cgt]a|t[acg]taccct 805
agggtaa[cgt]|[acg]ttaccct 1086

25416745
25000000
33399408

real 0m18.103s
user 0m0.015s
sys 0m0.000s

Jun 27 '08 #339
On Tue, 10 Jun 2008 03:37:38 +0100, Jon Harrop <jo*@ffconsulta ncy.com>
wrote:
>You tweaked Java's GC parameters so Jon Skeet tweaked .NET's GC parameters
and we all got different results.
No, you shifted your claim before Jon Skeet's tweak. The google
archive shows that. You are just inconsistent.
Jun 27 '08 #340

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
9791
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
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...
1
10844
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
10410
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...
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
5990
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.