cost of Java "assert" when disabled?

Srinivas Ramakrishna ysr1729 at gmail.com
Thu Feb 16 12:42:45 PST 2012


A Java language newbie question:

Does anyone have any ballpark numbers on the cost (and its scaling) of
peppering assert's in your Java code, but with asserts disabled (-da) ?
In other words, is the disabled cost so vanishingly small that we need not
think twice when using them, or should one be
careful because the cost is non-negligible and can affect (bytecode)
footprint or rutime performace even when switched off?

thanks for any advice.
-- ramki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20120216/65f8f48c/attachment.html 


More information about the hotspot-dev mailing list