Actually i remember a very objective form of testing performed by Omid David Tabibi.
C# versus C versus JAVA.
For simple programs, the result was already shocking, even worse than we had thought.
C# is about factor 3 slower than C.
JAVA has a similar faith. Factor 3 is very accurate.
The examples shown by Sun are not very fair. They compare some old crappy C console driver with totally different new fresh pgo'ed JAVA code in order to show JAVA isn't a lot slower.
The reality is different.
Factor 3 for very well programmed optimized C code versus JAVA is a real good estimate.
I remember a team i led (JAVA team), some years ago, we stumbled upon real big horrors nonstop in JAVA.
JAVA you must not see as a programming language to write speed dependant applications. See it as a programming language which allows to easily make GUI's and which is cross portable over systems.
That's a real huge advantage of it.
But now take our 3d engine in diep for example. That'll run quite a lot slower. In C you can optimize in a way that you can even use SSE2 if a processor has it.
JAVA is great for telecommunications companies who base everything upon Sun and java solutions they use from Sun.
Connectivity with database (Oracle) nowadays has improved dramatically from the days i led that team and we tried to get to work some intranet thing which allowed for researchers of the government institute to lookup all kind of data.
Especially important is that if within some agency you want to share data within departments, like statistical data (such as how many poison there is on each square meter in a certain area), then JAVA is an ideal tool to connect in a safe reliable way the intranet such that only that data can get out of database where the users in question have clearance for.
Because Sun is a big player at the telecommunication, *the biggest player*, JAVA has been promoted a lot by them.
But please be realistic.
Here is if you do some programming in C.
I have a position far away in shared memory. I want to access it.
I just unset a splitpoint for parallel search:
localsplitpoint = localsplitpoint->father;
Now if i would try to do without too many difficult pointers,
that is if i want to do without pointers in shared memory
that already translates to:
splittreeid = procprop[ProcessNumber]->getsplit_splittreeid;
localsplitpoint = &(procprop[(splittreeid&MAXPROCSMASK)]->split_tree[(splittreeid>>MAXPROCSBITS)]);
See this still is with some pointers. Imagine how ugly it looks when i do completely without pointers and work completely array based.
Not only is the above a real slow construction, it's real ugly too.
Java is ugly if code gets complicated.
If pointers get used wisely, you can really avoid a lot of troubles.
Making a programming language where people cannot mess up is wishful thinking anyway.
It is the sheer overhead that JAVA generates that slows things down.
It is because of Sun that JAVA has become a major success.
M$ of course soon after java started with thair c# project.
Whatever you say, Sun was first to figure out a new language and support it.
Honestely if you ask me, i dislike what m$ has done. C# is even worse than JAVA.
Vincent
Jonatan Pettersson wrote:Hi, new to these forums.
I've been writing an engine for the passed couple of months and chose Java due to other considerations than speed.
I was wondering how these two languages compare in speed. I realize C should be faster since it doesn't require the Java-'translation'.
I've no real intention of writing a super fast engine, and I don't need exceptional speed.
But how much of a difference is there? And is Java reasonable?