Enhanced performance of determinant calculation