473,289 Members | 1,780 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,289 software developers and data experts.

Execution speed, Java vs. C#/J#

Has anyone made any tests they'd like to tell me about?

--

Michael A. Covington - Artificial Intelligence Ctr - University of Georgia

"In the core C# language it is simply not possible to have an uninitialized
variable, a 'dangling' pointer, or an expression that indexes an array
beyond its bounds. Whole categories of bugs that routinely plague C and C++
programs are thus eliminated." - A. Hejlsberg, The C# Programming Language
Nov 16 '05 #1
8 11186
http://www.gotdotnet.com/team/compare/petshop.aspx

--
W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
"Michael A. Covington" <lo**@www.covingtoninnovations.com.for.address> wrote
in message news:uJ**************@TK2MSFTNGP11.phx.gbl...
Has anyone made any tests they'd like to tell me about?

--

Michael A. Covington - Artificial Intelligence Ctr - University of Georgia

"In the core C# language it is simply not possible to have an uninitialized variable, a 'dangling' pointer, or an expression that indexes an array
beyond its bounds. Whole categories of bugs that routinely plague C and C++ programs are thus eliminated." - A. Hejlsberg, The C# Programming Language

Nov 16 '05 #2
> > Has anyone made any tests they'd like to tell me about?

What about essentially the same program running in Java and compiled in J#?
Or the same algorithm in Java and C#?
Nov 16 '05 #3
Yes, take an RDBMS application and put all the data in memory; it's
astonishing how much faster it goes.

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:uh**************@TK2MSFTNGP09.phx.gbl...
http://www.gotdotnet.com/team/compare/petshop.aspx

--
W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
"Michael A. Covington" <lo**@www.covingtoninnovations.com.for.address> wrote in message news:uJ**************@TK2MSFTNGP11.phx.gbl...
Has anyone made any tests they'd like to tell me about?

--

Michael A. Covington - Artificial Intelligence Ctr - University of Georgia
"In the core C# language it is simply not possible to have an

uninitialized
variable, a 'dangling' pointer, or an expression that indexes an array
beyond its bounds. Whole categories of bugs that routinely plague C and

C++
programs are thus eliminated." - A. Hejlsberg, The C# Programming

Language


Nov 16 '05 #4
William Ryan eMVP <do********@comcast.nospam.net> wrote:
http://www.gotdotnet.com/team/compare/petshop.aspx


That has been a highly controversial benchmark though, with many people
finding easily fixable performance problems in the Java implementation
and serious design flaws in the .NET implementation.

The real bottom line (IMO) is that there are some situations where Java
will perform faster than .NET, and some situations where .NET will
perform faster than Java, running like-for-like code. You're much more
likely to see performance differences due to architectural differences
(as with the Petshop example) which will require balancing
elegance/maintainability and performance, than you will see differences
due to the CLR vs the JVM.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #5
> Michael A. Covington - Artificial Intelligence Ctr - University of Georgia

"In the core C# language it is simply not possible to have an uninitialized variable, a 'dangling' pointer, or an expression that indexes an array
beyond its bounds. Whole categories of bugs that routinely plague C and C++ programs are thus eliminated." - A. Hejlsberg, The C# Programming

Language

Between C# and J# should be no difference, since both run in the CLR and
producing IL-code and calling .NET framework methods.
Maybe C# could be a bit fast because J# has lots of classes emulating a JVM
which internally just calls the .NET framework.

For C# vs. Java, there should be no significant difference. The only
difference is a GUI application where C# is significantly faster since it
uses native windows controls.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
Nov 16 '05 #6
Jon Skeet [C# MVP] <sk***@pobox.com> wrote in
news:MP***********************@msnews.microsoft.co m:
William Ryan eMVP <do********@comcast.nospam.net> wrote:
http://www.gotdotnet.com/team/compare/petshop.aspx
That has been a highly controversial benchmark though, with many people
finding easily fixable performance problems in the Java implementation
and serious design flaws in the .NET implementation.


To quote the web page for the Sun Java Pet Store application:
JavaTM Pet Store Demo 1.3.2
The Java Pet Store Demo is a sample application from the Java 2
Platform, Enterprise Edition ("J2EE") BluePrints Program at Java
Software, Sun Microsystems. It demonstrates how to use the capabilities
of the J2EE 1.3 platform to develop flexible, scalable, cross-platform
enterprise applications. The Java Pet Store Demo comes with full source code and documentation,
which illustrate the typical design decisions and tradeoffs a developer
makes when building an enterprise application. The demo shows how to
use JavaServer Pages ("JSP"), JavaTM Servlet, Enterprise JavaBeans
("EJBTM"), and Java Message Service ("JMS") technologies. It also uses
new technologies in the J2EE 1.3 platform, which you can experiment
with and learn how to use in your own enterprise solutions. With real, working code illustrating the BluePrints guidelines, the
Java Pet Store Demo reduces the learning curve of the J2EE 1.3
platform, enabling you to deliver complete end-to-end solutions with
faster time-to-market.


According to this, I would understand the Pet Store to be the way Sun
wants people to write proper Java applications which are "flexible,
scalable, cross-platform".

The sad truth however is that once Microsoft went through the hoops of
rewriting it so that it outruns the java version by several factors,
people have gone to a great length picking apart the Java version and
found a lot of problems with it, like under-use of stored procedures.

This means that the benchmarks simply benchmark a java implementation of
the Pet Store and a .NET implementation of the same, with somewhat the
same functionality. It does not benchmark the platforms they run on.

I would consider this the same as implementing a bubble-sort in Java and
a quicksort in .NET and then claim .NET is superior to Java, or vice
versa.

It is a big strange though that Sun hasn't either changed the wording on
their web page, gone out and clarified their stand on this, or fixed the
application.

--
Lasse Vågsæther Karlsen
la***@vkarlsen.no
PGP KeyID: 0x0270466B
Nov 16 '05 #7
Lasse Vågsæther Karlsen <la***@vkarlsen.no> wrote:
William Ryan eMVP <do********@comcast.nospam.net> wrote:
http://www.gotdotnet.com/team/compare/petshop.aspx
That has been a highly controversial benchmark though, with many people
finding easily fixable performance problems in the Java implementation
and serious design flaws in the .NET implementation.


To quote the web page for the Sun Java Pet Store application:
JavaTM Pet Store Demo 1.3.2
The Java Pet Store Demo is a sample application from the Java 2
Platform, Enterprise Edition ("J2EE") BluePrints Program at Java
Software, Sun Microsystems. It demonstrates how to use the capabilities
of the J2EE 1.3 platform to develop flexible, scalable, cross-platform
enterprise applications.

The Java Pet Store Demo comes with full source code and documentation,
which illustrate the typical design decisions and tradeoffs a developer
makes when building an enterprise application. The demo shows how to
use JavaServer Pages ("JSP"), JavaTM Servlet, Enterprise JavaBeans
("EJBTM"), and Java Message Service ("JMS") technologies. It also uses
new technologies in the J2EE 1.3 platform, which you can experiment
with and learn how to use in your own enterprise solutions.

With real, working code illustrating the BluePrints guidelines, the
Java Pet Store Demo reduces the learning curve of the J2EE 1.3
platform, enabling you to deliver complete end-to-end solutions with
faster time-to-market.


According to this, I would understand the Pet Store to be the way Sun
wants people to write proper Java applications which are "flexible,
scalable, cross-platform".


Right - although I don't believe they're claiming it's as optimised as
it might be.
The sad truth however is that once Microsoft went through the hoops of
rewriting it so that it outruns the java version by several factors,
people have gone to a great length picking apart the Java version and
found a lot of problems with it, like under-use of stored procedures.
Sure. A lot of these problems can be fixed *without* changing the
overall architecture, however - whereas the latter is what MS did.
This means that the benchmarks simply benchmark a java implementation of
the Pet Store and a .NET implementation of the same, with somewhat the
same functionality. It does not benchmark the platforms they run on.
But the point is it's *not* a .NET implementation of the same - they've
thrown away the MVC nature of it, to start with.
I would consider this the same as implementing a bubble-sort in Java and
a quicksort in .NET and then claim .NET is superior to Java, or vice
versa.
Exactly. It's basically completely useless as a benchmark, as far as I
can see.
It is a big strange though that Sun hasn't either changed the wording on
their web page, gone out and clarified their stand on this, or fixed the
application.


Indeed. I think enough people have realised that it's a bogus benchmark
that they've decided not to pursue it, but I agree it's somewhat odd.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #8
Jon Skeet [C# MVP] <sk***@pobox.com> wrote in
news:MP************************@msnews.microsoft.c om:
Lasse Vågsæther Karlsen <la***@vkarlsen.no> wrote:
> William Ryan eMVP <do********@comcast.nospam.net> wrote:
>> http://www.gotdotnet.com/team/compare/petshop.aspx
<snip> the Pet Store and a .NET implementation of the same, with somewhat
the same functionality. It does not benchmark the platforms they run
on.


But the point is it's *not* a .NET implementation of the same -
they've thrown away the MVC nature of it, to start with.

<snip>

Right, that's what I meant, should've been a bit clearer :)

What I meant to say is that Microsoft has focused on the functionality as
seen by the end-user, and used whatever means they can to make the back-end
provide that functionality in a fast manner, even if that meant doing
things in a very different way from what the Java version does.
--
Lasse Vågsæther Karlsen
la***@vkarlsen.no
PGP KeyID: 0x0270466B
Nov 16 '05 #9

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

Similar topics

30
by: Mike Cox | last post by:
Hi. I recently ran a benchmark against two simple programs, one written in Java and the other in C++. The both accomplish the same thing, outputting "Hello World" on my screen. The C++ program...
3
by: linvin333 | last post by:
Hi, Does function overloading affect the speed of execution of the program ? If so what is the reason ? How does it compare with a speed of a program using non-overloded functions ? Linny
19
by: Davey | last post by:
Which is typically faster - a Java server application or a C++ server application?
38
by: vashwath | last post by:
Might be off topic but I don't know where to post this question.Hope some body clears my doubt. The coding standard of the project which I am working on say's not to use malloc.When I asked my...
53
by: Krystian | last post by:
Hi are there any future perspectives for Python to be as fast as java? i would like to use Python as a language for writing games. best regards krystian
17
by: romixnews | last post by:
Hi, I'm facing the problem of analyzing a memory allocation dynamic and object creation dynamics of a very big C++ application with a goal of optimizing its performance and eventually also...
40
by: kavi | last post by:
Hello friends, Could any one tell the way of calculating the speed of c program execution?
18
by: Tom Cole | last post by:
I'm working on a small Ajax request library to simplify some tasks that I will be taking on shortly. For the most part everything works fine, however I seem to have some issues when running two...
25
by: Umesh | last post by:
i want to calculate the time required to execute a program. Also i want to calcute the time remaining for the execution of the program. how can i do that? pl mention some good websites for...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.