lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@lucene.com>
Subject Re: BitVector, public byte[] bits
Date Tue, 11 Feb 2003 17:54:39 GMT
Tatu Saloranta wrote:
> Just a quick question about BitVector implementation. Comments for
> member variable 'bits' say:
> 
>   /** This is public just so that methods will inline.  Please don't touch.*/
>   public byte[] bits;
> 
> I'm curious about whether this holds true generally... are JIT compilers known
> not to inline methods that access protected/private fields? It seems bit 
> counter-intuitive (or at least different from method handling, where private 
> methods are primary candidates for inlining), but if this is the cases it's 
> something good to know (for commonly used data struct classes at least).
> [I tried Google search to find references, but couldn't find any... if someone 
> has pointers that'd be great]

I think this dates from earlier days of Java, when javac would inline 
some methods, and that gave a significant performance boost.  Nowadays 
inlining is done by JITs and this is probably archaic.  I would vote to 
remove the comment and make the field private.  (And I hope no other 
code is relying on direct access to the byte array...)

Doug



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message