[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [computer-go] Score estimating



The Java VM is not really much slower than C/C++, *but* the Java language
can end up slowing you down.
Because Java lacks immediate (or stack) object allocation, one is penalized
for abstraction.  Every object in Java must be allocated on the heap, and
this (object allocation & GC) is the primary place where Java loses some
speed.  As an example, a Rectangle class with two Point objects will be
slightly slower in Java than a Rectangle class with 4 integer coordinates.
In C++, the two classes should have the same performance.

If you are doing purely numerical computation (almost no objects being
allocated), then Java is almost as fast as C++.  In fact, I have some
experience with the latest 1.4.2 server JVMs outperforming gcc -O3 but
slightly underperforming the Intel and MS C++ compilers.

If one writes C++ like Java (allocating all of the objects on the heap,
etc), then Java will most often outperform C++.  IMHO, that's not a fair
comparison since one wouldn't write highly optimized C++ that way.

-Yonik

----- Original Message ----- 
> >
> >By the way: I am working in java, if anyone wants to know.
> >
> I realized that several Go projects are written in Java. I am an hacker
from
> the computer-stone-age and have written the time critical parts of my
> chessprograms in Assembler. Is Java not considerable slower than C/C++? Or
> is this not true anymore? Or does speed not matter in a Go-Programm. Is
ease
> of programming more important? (Although I see in this respect no big
> difference between C(++) and Java).
>
> My question has nothing to do with score-estimation, but I wanted to ask
> this already on other contributions who mentioned Java. Actually the real
> background of this question is that I have difficulties to understand the
> Go-programming paradigm. Speed is everything in chess and it is therefore
> difficult to imagine, that it should not be in Go.
>
> There were some plans to write together with Peter Woitke (GoAhead) a new
> Go-program. One of Peters basic requirements was: If time and/or
processing
> power increases, the strength of the programm increases. Especially if
time
> goes to infinity, the playing strength does the same.
> I had problems to understand this requirement at all because in
> computer-chess it is obvious. But Go programs seem to have a problem to
use
> "infinite" time or processing power. One consequence of this paradigm is:
> Although there are much more moves than in chess, the time setting for a
> computer-Go game is much shorter. If there appear programs who could use
> time wisely one would have to discuss this settings.
>
> Best Regards
> Chrilly Donninger

_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/