Performance drag of Java assertions when disabled
Contrary to the conventional wisdom, asserts do have a runtime impact and may affect performance. The impact is likely to be small on average and zero in the median case, but it could be large when the stars align just right. Some of the mechanisms by which asserts slow things down at runtime are fairly …