Re: use of Unsafe for ASCII detection

2016-01-13 Thread Andrew Haley
On 12/01/16 20:49, Aleksey Shipilev wrote: > Okay, I'll bite: > http://cr.openjdk.java.net/~shade/scratch/UTF8Scan.java Great job, Aleksey. Far more thorough than I would have done! Andrew.

Re: use of Unsafe for ASCII detection

2016-01-12 Thread Aleksey Shipilev
On 01/07/2016 02:21 AM, Martin Buchholz wrote: > A stupid benchmark (sorry Aleksey - maybe you already have a jmh > version of this?) http://cr.openjdk.java.net/~martin/Utf8Bench.java Okay, I'll bite: http://cr.openjdk.java.net/~shade/scratch/UTF8Scan.java As Andrew already pointed out, the tri

RE: use of Unsafe for ASCII detection

2016-01-07 Thread Uwe Schindler
Hi, > On 06/01/16 23:21, Martin Buchholz wrote: > > > That is, the Unsafe code is 3x faster than the simple code. The > > ByteBuffer code used to be 2x slower and is now 2x faster - well > > done - crowd goes wild! > > Why, thank you. > > > I see it uses new and well-hidden Unsafe.getLongUnal

Re: use of Unsafe for ASCII detection

2016-01-07 Thread Andrew Haley
On 06/01/16 23:21, Martin Buchholz wrote: > That is, the Unsafe code is 3x faster than the simple code. The > ByteBuffer code used to be 2x slower and is now 2x faster - well > done - crowd goes wild! Why, thank you. > I see it uses new and well-hidden Unsafe.getLongUnaligned ... all > the perf