[EMAIL PROTECTED] wrote:
> 
> Hi all,
> 
> In many classes, to detect the need of array-resizing, we try to access a
> specific position, and do the resizing when
> "ArrayIndexOutOfBoundsException" is caught (or NullPointerException for
> multidimensional arrays).
> 
> But my understanding is that throw-catch exceptions is much more expensive
> than get the array size directly: arrayVal.length. So there would be a big
> performance hit if we resize arrays frequently. (In fact, we do resize
> StringPool very often.)

I understand throw-catch performance as unpredictable. Actual performance
depends on how deep a stack trace is. Filling the stack trace takes a lot of 
time. The deeper stack the more time is taken.

  Cc.

-- 
<address>
<a href="mailto:[EMAIL PROTECTED]";>Petr Kuzel</a>, Sun Microsystems
: <a href="http://www.sun.com/forte/ffj/ie/";>Forte Tools</a>
: XML and <a href="http://jini.netbeans.org/";>Jini</a> modules</address>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to