473,703 Members | 2,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11201
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.covin gtoninnovations .com.for.addres s> wrote
in message news:uJ******** ******@TK2MSFTN GP11.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********@com cast.nospam.net > wrote in message
news:uh******** ******@TK2MSFTN GP09.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.covin gtoninnovations .com.for.addres s> wrote in message news:uJ******** ******@TK2MSFTN GP11.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********@com cast.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.co m>
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.co m> wrote in
news:MP******** *************** @msnews.microso ft.com:
William Ryan eMVP <do********@com cast.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********@com cast.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.co m>
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.co m> wrote in
news:MP******** *************** *@msnews.micros oft.com:
Lasse Vågsæther Karlsen <la***@vkarlsen .no> wrote:
> William Ryan eMVP <do********@com cast.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
2804
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 took .5 seconds to complete on my 400 Mhz PC while the Java program took 6.5 seconds. I am running the SUSE 8.2 Linux distribution. Why is Java that much slower than the C++ program? I read on Slashdot that Java was almost as fast as C++. ...
3
1404
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
3195
by: Davey | last post by:
Which is typically faster - a Java server application or a C++ server application?
38
2553
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 lead(I have just started working) he said we should not use dynamic allocation in real time systems, the code will not run in predictable time period.Can anybody tell what does he mean?Why the execution time becomes unpredictable? Thanks
53
3423
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
5077
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 identifying memory leaks. The application in question is the Mozilla Web Browser. I also have had similar tasks before in the compiler construction area. And it is easy to come up with many more examples, where such kind of statistics can be very...
40
2973
by: kavi | last post by:
Hello friends, Could any one tell the way of calculating the speed of c program execution?
18
1923
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 requests at the same time. The first one stops execution as the second continues. If I place either an alert between the two requests or run the second through a setTimeout of only 1 millisecond, they both work. You can see a working example here:...
25
5010
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 learning advanced C.thx.
0
8654
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
9234
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...
1
8983
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
7832
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
4412
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3107
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
2
2406
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2037
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.