Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: