Hi Martin,

In this case i am trying to pick off one particularly common case, within the 9 
time-frame, used in a number of popular libraries. In that context (including 
that of the intrinsic referenced in the related issue) do you think this is 
reasonable?


On Feb 10, 2015, at 8:48 PM, Martin Buchholz <marti...@google.com> wrote:

> People will continue to want to access byte arrays (and direct byte buffers) 
> with C-like performance, and are currently using Unsafe to do so.
> Hard to fix for real.

Yes, that is a much larger problem that i hope both value types and panama will 
address more fully.


>   Endianness and unaligned access are both non-portable aspects.  People 
> don't want to pay for bounds checking and especially not for alignment 
> checking of indexes known to be aligned. 

Note that as part of the VarHandles work we will try and improve the strength 
reduction of bounds checks for array access. If we expose an intrinsic for 
unsigned integer comparison that can be reused within the nio buffers.


> Lexicographic comparison is only one use case (that happened to be important 
> performance wise for guava). I have long thought that arrays should acquire 
> more listesque methods (e.g. contains, indexOf), even though arrays are 
> unpopular.  

> 

Yes, i was wondering the same, there should be an interface. But i think that 
is an arrays 2.0 and value types thing.

Paul.

Reply via email to