Re: Lexicographic array comparators

2015-02-20 Thread Andrew Haley
On 02/13/2015 02:58 PM, Paul Sandoz wrote: > > On Feb 13, 2015, at 3:31 PM, Andrew Haley wrote: > >> On 02/13/2015 01:56 PM, Paul Sandoz wrote: >>> John suggested that a general array mis-match method could be achieved with >>> carefully written Java code [1], and slightly hidden within that is

Re: Lexicographic array comparators

2015-02-13 Thread Paul Sandoz
On Feb 13, 2015, at 3:31 PM, Andrew Haley wrote: > On 02/13/2015 01:56 PM, Paul Sandoz wrote: >> John suggested that a general array mis-match method could be achieved with >> carefully written Java code [1], and slightly hidden within that is the >> comment "FIXME: Add Unsafe.getLongMisaligne

Re: Lexicographic array comparators

2015-02-13 Thread Andrew Haley
On 02/13/2015 01:56 PM, Paul Sandoz wrote: > John suggested that a general array mis-match method could be achieved with > carefully written Java code [1], and slightly hidden within that is the > comment "FIXME: Add Unsafe.getLongMisaligned to avoid this cutout". Right, so we're definitely thin

Re: Lexicographic array comparators

2015-02-13 Thread Paul Sandoz
On Feb 13, 2015, at 2:16 PM, Andrew Haley wrote: > On 02/10/2015 07:48 PM, Martin Buchholz 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. Endianness and unal

Re: Lexicographic array comparators

2015-02-13 Thread Andrew Haley
On 02/10/2015 07:48 PM, Martin Buchholz 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. Endianness and unaligned access are > both non-portable aspects. People don't

Re: Lexicographic array comparators

2015-02-11 Thread Paul Sandoz
On Feb 11, 2015, at 12:15 AM, Martin Buchholz wrote: > The addition of array comparison intrinsics makes sense - I've missed them > myself on occasion. > Thanks. > I was surprised that System.arraycopy hasn't been specialized for every array > type. > I guess the JIT is good at specializing

Re: Lexicographic array comparators

2015-02-11 Thread Paul Sandoz
On Feb 11, 2015, at 12:26 AM, John Rose wrote: > On Feb 10, 2015, at 3:15 PM, Martin Buchholz wrote: >> >> I was surprised that System.arraycopy hasn't been specialized for every >> array type. >> I guess the JIT is good at specializing all callers. > > Yes. Usually the arguments have specific

Re: Lexicographic array comparators

2015-02-10 Thread John Rose
On Feb 10, 2015, at 3:15 PM, Martin Buchholz wrote: > > I was surprised that System.arraycopy hasn't been specialized for every > array type. > I guess the JIT is good at specializing all callers. Yes. Usually the arguments have specific static types the JIT can see. The Object formal type does

Re: Lexicographic array comparators

2015-02-10 Thread Martin Buchholz
The addition of array comparison intrinsics makes sense - I've missed them myself on occasion. I was surprised that System.arraycopy hasn't been specialized for every array type. I guess the JIT is good at specializing all callers. I don't know whether we will someday regret the explosion of arra

Re: Lexicographic array comparators

2015-02-10 Thread Paul Sandoz
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

Re: Lexicographic array comparators

2015-02-10 Thread Martin Buchholz
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. Endianness and unaligned access are both non-portable aspects. People don't want to pay for bounds checking and especially not for a