cost of Java "assert" when disabled?
vitalyd at gmail.com
Thu Feb 16 13:59:36 PST 2012
I think one problem with them is that they count towards the inlining
budget since their bytecodes still take up space. Not sure if newer C1/C2
compiler builds are "smarter" about this nowadays.
Sent from my phone
On Feb 16, 2012 4:44 PM, "John Pampuch" <john.pampuch at oracle.com> wrote:
> My rather ancient understanding is that properly structured assertions are
> near zero cost when they are turned off. Perhaps someone knows of some
> tests that confirm this?
> On 2/16/12 12:42 PM, Srinivas Ramakrishna wrote:
> 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...
More information about the hotspot-dev