3 ms·
Presumably it depends on the complexity of the logic that has to be evaluated to determine whether the assertion passes. I've seen math libraries where, for ex
by michaelt 14y ago
Presumably it depends on the complexity of the logic that has to be evaluated to determine whether the assertion passes.
I've seen math libraries where, for example, the invert-matrix function finishes with an assertion that the input matrix multiplied with the output matrix is the identity matrix. That's a reasonable enough test, but it means when you enable assertions you see a major performance hit.