473,396 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Why is C# so slow in this benchmark vs Java

I was looking at this page

http://www.garret.ru/~knizhnik/dybase/doc/dybase.html

And noticed running the same code (Java ported to C# using the MS tool I
expect) that the C# implementation is over 50% slower than Java in all
tests. Coming in at the same speed as Ruby, which isn't known for it's
speed, but is totally dynamic and interpreted. Something doesn't seem quite
right.

Color Language Database
1 C++ GigaBASE
2 Java PERST
3 C-Sharp PERST
4 Ruby DyBase
5 Python DyBase
6 PHP DyBase

Index searches per second
1 297177
2 76923
3 28571
6 9524
4 9091
5 8961
Stored objects per second
1 45600
2 14285
3 7142
4 6667
5 6072
6 5555
Removed objects per second
1 39308
2 20000
3 6250
4 6250
6 4615
5 4545
Nov 15 '05 #1
7 1858
Yeah, the C++ implementation should probably not have been over 10 times
faster in the benchmarks either. I think something else is being
benchmarked here. Perhaps our gullibility???

"Ralph Mason" <ma*************************@thisisnotarealaddress .com> wrote
in message news:eA**************@TK2MSFTNGP09.phx.gbl...
I was looking at this page

http://www.garret.ru/~knizhnik/dybase/doc/dybase.html

And noticed running the same code (Java ported to C# using the MS tool I
expect) that the C# implementation is over 50% slower than Java in all
tests. Coming in at the same speed as Ruby, which isn't known for it's
speed, but is totally dynamic and interpreted. Something doesn't seem quite right.

Color Language Database
1 C++ GigaBASE
2 Java PERST
3 C-Sharp PERST
4 Ruby DyBase
5 Python DyBase
6 PHP DyBase

Index searches per second
1 297177
2 76923
3 28571
6 9524
4 9091
5 8961
Stored objects per second
1 45600
2 14285
3 7142
4 6667
5 6072
6 5555
Removed objects per second
1 39308
2 20000
3 6250
4 6250
6 4615
5 4545

Nov 15 '05 #2
"Ralph Mason" <ma*************************@thisisnotarealaddress .com>
wrote in news:eA**************@TK2MSFTNGP09.phx.gbl:
I was looking at this page

http://www.garret.ru/~knizhnik/dybase/doc/dybase.html

And noticed running the same code (Java ported to C# using the MS tool I
expect) that the C# implementation is over 50% slower than Java in all
tests. Coming in at the same speed as Ruby, which isn't known for it's
speed, but is totally dynamic and interpreted. Something doesn't seem
quite right.


As with any benchmark using a database: you're testing the database
driver, since that's the bottleneck. Apparently, the guy who wrote DyBase
hasn't come up with a very good C# driver.

FB

--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com
Nov 15 '05 #3
I don't think there's enough information there to draw much of a conclusion.
We don't know how the database is accessed nor is there a link to the code
that he used. We don't even know (for example) if he compiled with
optimization turned on.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
"Ralph Mason" <ma*************************@thisisnotarealaddress .com> wrote
in message news:eA**************@TK2MSFTNGP09.phx.gbl...
I was looking at this page

http://www.garret.ru/~knizhnik/dybase/doc/dybase.html

And noticed running the same code (Java ported to C# using the MS tool I
expect) that the C# implementation is over 50% slower than Java in all
tests. Coming in at the same speed as Ruby, which isn't known for it's
speed, but is totally dynamic and interpreted. Something doesn't seem quite right.

Color Language Database
1 C++ GigaBASE
2 Java PERST
3 C-Sharp PERST
4 Ruby DyBase
5 Python DyBase
6 PHP DyBase

Index searches per second
1 297177
2 76923
3 28571
6 9524
4 9091
5 8961
Stored objects per second
1 45600
2 14285
3 7142
4 6667
5 6072
6 5555
Removed objects per second
1 39308
2 20000
3 6250
4 6250
6 4615
5 4545

Nov 15 '05 #4
"Eric Gunnerson [MS]" <er****@online.microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I don't think there's enough information there to draw much of a conclusion. We don't know how the database is accessed nor is there a link to the code
that he used. We don't even know (for example) if he compiled with
optimization turned on.


The code can be found here http://www.garret.ru/~knizhnik/perst.html (both
Java and C# versions)

As I said it's a direct port from the java code.

Ralph
Nov 15 '05 #5
Ralph Mason <ma*************************@thisisnotarealaddress .com>
wrote:
The code can be found here http://www.garret.ru/~knizhnik/perst.html (both
Java and C# versions)

As I said it's a direct port from the java code.


That could be a problem in itself. While similar, Java and C# have
different idioms. Java JITs have evolved to make virtual method calls
very fast when they haven't been overridden, whereas .NET hasn't gone
that way as methods aren't virtual by default. A straight blind port
from the Java would make most of the methods virtual, which could make
a significant different.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #6
I looked at this a bit, but I'm afraid I wasn't able to reach any
conclusions. To figure out what is going on you'd need to run a profiler on
the code.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
"Ralph Mason" <ma*************************@thisisnotarealaddress .com> wrote
in message news:u1**************@TK2MSFTNGP10.phx.gbl...
"Eric Gunnerson [MS]" <er****@online.microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I don't think there's enough information there to draw much of a

conclusion.
We don't know how the database is accessed nor is there a link to the code that he used. We don't even know (for example) if he compiled with
optimization turned on.


The code can be found here http://www.garret.ru/~knizhnik/perst.html (both
Java and C# versions)

As I said it's a direct port from the java code.

Ralph

Nov 15 '05 #7
I looked at this a bit, but I'm afraid I wasn't able to reach any
conclusions. To figure out what is going on you'd need to run a profiler on
the code.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
"Ralph Mason" <ma*************************@thisisnotarealaddress .com> wrote
in message news:u1**************@TK2MSFTNGP10.phx.gbl...
"Eric Gunnerson [MS]" <er****@online.microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I don't think there's enough information there to draw much of a

conclusion.
We don't know how the database is accessed nor is there a link to the code that he used. We don't even know (for example) if he compiled with
optimization turned on.


The code can be found here http://www.garret.ru/~knizhnik/perst.html (both
Java and C# versions)

As I said it's a direct port from the java code.

Ralph

Nov 15 '05 #8

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

Similar topics

13
by: Jesse Thompson | last post by:
Greetings fell XML folk. I've just gotten started making SAX filters in Perl. I was hoping to build an XML templating engine this way, but the performance of XML::SAX::Expat and XML::SAX::Writer...
9
by: Greg Buchholz | last post by:
/* While writing a C++ version of the Mandelbrot benchmark over at the "The Great Computer Language Shootout"... http://shootout.alioth.debian.org/gp4/benchmark.php?test=mandelbrot&lang=all ...
6
by: lawrence k | last post by:
The following function is way too slow. If anyone has any suggestions about how to speed it up, I'd be grateful for them. We have to call this function 36 times on one page, and I think each time...
2
by: existential.philosophy | last post by:
This is a new problem for me: I have some queries that open very slowly in design view. My benchmark query takes about 20 minutes to open in design view. That same query takes about 20 minutes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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,...

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.