Author: Angrim
Date: 12:16:45 02/10/01
Go up one level in this thread
On February 10, 2001 at 14:50:13, James Swafford wrote:
>>
>>There is no reasons for compiled (as opposed to interpreted) Java to be slower
>>than C. The question is if the available compilers are good enough.
>
>My understanding of Java (even compiled Java) is that it is slower
>because it translates into more machine language instruction.
>
>For example, C does not do "garbage collection," but Java does.
>In other words, in C if you allocate memory to three structures,
>then free the middle one, there is a "whole" in memory that you
>can only use if you allocate memory <= the size of that whole.
>In Java, once you free the middle structure, it will "compact"
^^^^^^^^^^^^ your missing the point. In java you don't
free memory. What garbage collection does is go around looking
for memory that you are no longer useing and freeing it for you.
If you allocate a lot of memory, ie. a movelist object for each node
in the search tree, the garbage collection will suck up a lot of cpu.
In general, Java does a lot of extra work to protect you from making
simple dumb mistakes that would crash a C program. Very nice for a
beginner, or a single use program that you don't want to waste time
debugging, but it doesn't allow for the posibility of saying that you
are done debugging a module and want it to stop double checking
everything that you do.
ie. you have a "int b[64], i; for i = 8 to 15 do b[i]=1;" equivalent
java will still check that you aren't writing off the end of the array
*at run time* for each reference to b
Angrim
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.