I have implemented minimax algorithm for an unbeatable tic toc toe game. The minimax algorithm is recursive, performing big iterations, which are not big for the computer, only
Use a profiler to pinpoint where the code is slow.
Here's the profiler result using Google Chrome.
The problem seems to start from the function minimaxMove.
minimaxMove