Just walk beside me and be my friend <a href="http://www.codemiles.com" target="_blank" rel="nofollow"><b>Java problems</b></a>,<a href="http://www.codemiles.com/viewforum.php?f=109" target="_blank" rel="nofollow"><b>Applet Games</b></a>
<a href="http://www.java-forums.org" target="_blank" rel="nofollow">Java</a>
Originally posted by vikas chess:
c is faster than java.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Originally posted by Peter Chase:
Not necessarily.
It was very true up to version 1.2 of Java. It became less definite with 1.3 and is highly dubious now, with Java 6. HotSpot and GC are now very, very clever.
C programmers think that C's direct access to memory makes it faster. In fact, that can make it slower. Because Java applications cannot work directly with memory, the JVM can move stuff around for optimal performance, or not put it in RAM at all, in a way that C cannot. Also, Java's memory allocation and deallocation can sometimes be faster than C's.[ July 05, 2007: Message edited by: Peter Chase ]
Originally posted by vikas chess:
but in case of computing oriented code, c/c++ is still faster than java.
for some operations assembly code is used in my chess engine to make it faster, which is not possible in java.
applications based on AI technologies such as chess, robotics etc. c/c++ is better choice.
this is the reason why 99% chess engines are written in C/C++
Originally posted by Rahul Bhattacharjee:
Hi vikas chess ,
Kindly check with the javaranch's naming policy.I am sure chess is not your last name.
In terms of performance Java has improved a lot from its earlier version.It's JIT takes care of converting heavily used byte codes into native.
I have not done any performance benchmarking on java's speed , but I am sure that if its not faster , then its not much slower also.
Originally posted by Gavin Tranter:
You know, you can prove anything you wish with statistics.
I would say the reason 99% of chess engines are written in C/C++ is more to do with C/C++ having been around longer.
Originally posted by vikas chess:
when so many games are developed in java. why not chess?
one of my friend code a chess engine in java and then apply the same logic in c. his c code was running 20 times faster than java one
my last name is already taken by someone else
Originally posted by Ulf Dittmer:
I don't think there are many commercial games written in Java. Chess is too hard to do it well on a not-for-profit basis. And since for various reasons there is no market for commercial Java games, nobody who could do the chess part, will do it in Java.
Originally posted by Ulf Dittmer:
True, hand-crafted assembly code will often beat what a compiler can do. But Java can use JNI to include native code, although with a certain overhead. But if the assembly code is much faster, or runs for a while, it may still be beneficial.
Originally posted by vikas chess:
for your information, there are many commercial games developed in java especially j2me. none of the commercial chess engines are written in java.
if a person is writing a chess engine in java. he must be having sound knowledge of java. why don't you write a chess engine and compare its speed with c code?
its obvious chess can't be a last name. there is nothing to hide in it. and nor its a crime. i will change it later on. the new member may not be aware of all the rules. be on topic.
Originally posted by Ulf Dittmer:
Are there any good chess implementations for mobile phones, whatever the language.
I couldn't write a decent chess program in any language. I could write a bad one in any number of languages, most of which I know very well. That doesn't prove that it's impossible to write a decent or fast one in these languages.
Originally posted by Ulf Dittmer:
True, hand-crafted assembly code will often beat what a compiler can do.
Originally posted by Ernest Friedman-Hill:
Feh. This really isn't true anymore, either, although there are just as many ASM-vs-C bigots as C-vs-Java bigots who won't surrender the notion.
"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
Probably the best way to achieve that functionality in Java is with Long.numberOfTrailingZeros(). For a JDK earlier than JDK 5, you can just check out the source code from JDK 5 to see what they did.
."99% of chess engines are written in C/C++"
Originally posted by Gavin Tranter:
Just two ways of looking at the same "fact", heres another two: 99% of chess engines are written in a language that is at least 20-30years old. (not sure when C++ showed up).
It could be that 1% of none C/C++ chess engines are the best they possible can be, so no further development is need on them, and every body has chosen them as some defacto standard for that language. (Unlikely but certainly one way of looking at the "facts")
these are your assumptions not facts. daily hundreds of chess engines are developed, and most of them developed in c/c++. there are professional programmers whose livelihood is based on chess engines. none of them choose java. why? take example of fritz, deep junior, Rybka, Shredder, Zappa etc[ July 09, 2007: Message edited by: Gavin Tranter ][/QB]
"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
Originally posted by colin shuker:
Yes, good stuff, I think you understand it quite well.
Glad to be of some help though, maybe you can help me too with bits on my engine.
Add me to messenger if you want someone to chat chess engines with
(yahoo)cms271828@yahoo.co.uk,
(msn)colin.shuker@tiscali.co.uk
Thanks.
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|