By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,058 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,058 IT Pros & Developers. It's quick & easy.

Why is C# so slow in this benchmark vs Java

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.