Javascript performance test calculating all possible tictactoe outcomes