Page 3 of 3 [ 31 posts ]  Go to page Previous  1, 2, 3

EGMaria2004
Blue Jay
Blue Jay

User avatar

Joined: 30 Aug 2004
Gender: Female
Posts: 98
Location: New Zealand

27 Aug 2005, 6:20 pm

We got taught java in CS and had to use it for assignments. Quite often we have to write sorts or something like that.

I've heard that people say it's slow and has all these problems. So I thought as an extension excersise i'd write the same thing again in C and write one of those performance test scripts we always have to do. I failed to find much of a difference between the java and C program. Ok it was only mergesort on 100,000 numbers java took something like 0.001 of a second longer than the C program.

It could be that the lab machines are all brand new 3.2Ghz P4s with 1Gb of ram each, but i suspect it might be beause they are running linux and using the sun java runtime. I suspect that the java interpreter that comes with windows is rubbish.

A properly implimented abstract stack machine runtime using just in time compiliation should execute no slower than native code, but it will definately *load* more slowly, since what's really gone on is the run time is compiling the byte code to machine code into ram. Anything but minimal slowdown compared to native code is evidence of bad implimentation rather than anything actually wrong with this way of doing things. Then again by my standards every program ever written is poor implimentation :-P

As for my own programming I use java as a RAD tool mainly, and for making little GUI apps and things like that.

I use C and C++ for most stuff. When i've had a go at making games i've done C, C++ and Assembly mixes. Since java can't be mixed easiler with assembly and the runtime doesn't provide any way to access SIMD instructions, nor does it appear to be able to use them for vector calculations (this is the real reason games written in java would be hopelessly slow).