chesslablab / php-chess

A chess library for PHP.
https://chesslablab.github.io/php-chess/
MIT License
102 stars 46 forks source link

Improve the performance of the attack evaluation #549

Closed programarivm closed 4 months ago

programarivm commented 4 months ago

src/Eval/AttackEval.php has demonstrated to be not too efficient for games with a considerable number of moves, let's say 50 moves. So, this evaluation feature is not included in the website's Heuristic Charts.

output

Find out how to refactor it in such a way that it is more efficient.

Happy coding!

programarivm commented 4 months ago

At this moment, deep cloning of objects is achieved by using serialization.

$obj2 = unserialize(serialize($obj1));

However, the performance of object cloning may be improved with the help of DeepCopy.

See: