Hey,
I have a Java specific question. I have a static array for my history-heurstic (counterMovers and Killers as well). Now I read that static variable acess is slower compared to local varaible acess. I clear my heuristics everytime so would it be better to pass the history heuristics (counterMoves etc.) as a parameter to my search ?
Would like to know what you think
Robin
java and history heuristic
Moderator: Ras
-
sandermvdb
- Posts: 160
- Joined: Sat Jan 28, 2017 1:29 pm
- Location: The Netherlands
Re: java and history heuristic
I don't completely understand what you are saying but it is correct that static variables are slower than local variables. This will probably only be a couple of percent of the total calculation time when performing a search so readability and maintainability are way more important! Try not to spend much time on micro-optimizations which this isCheckersGuy wrote:Hey,
I have a Java specific question. I have a static array for my history-heurstic (counterMovers and Killers as well). Now I read that static variable acess is slower compared to local varaible acess. I clear my heuristics everytime so would it be better to pass the history heuristics (counterMoves etc.) as a parameter to my search ?
Would like to know what you think
Regarding clearing the array, use the method Arrays.fill()
Using tools like VisualVM you can analyze the performance of your engine
Goodluck!