lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: svn commit: r1379479 [1/12] - /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/
Date Fri, 31 Aug 2012 15:53:11 GMT
We can now also make BulkOperationPackedSingleBlock final like the other classes!

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: jpountz@apache.org [mailto:jpountz@apache.org]
> Sent: Friday, August 31, 2012 5:33 PM
> To: commits@lucene.apache.org
> Subject: svn commit: r1379479 [1/12] -
> /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/
> 
> Author: jpountz
> Date: Fri Aug 31 15:32:29 2012
> New Revision: 1379479
> 
> URL: http://svn.apache.org/viewvc?rev=1379479&view=rev
> Log:
> LUCENE-4322: Reduce lucene-core JAR size by unspecializing
> BulkOperationPackedSingleBlock and rolling back some loops.
> 
> Removed:
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock1.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock10.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock12.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock16.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock2.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock21.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock3.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock4.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock5.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock6.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock7.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock8.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPackedSingleBlock9.java
> Modified:
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> eration.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked1.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked10.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked11.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked12.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked13.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked14.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked15.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked16.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked17.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked18.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked19.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked2.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked20.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked21.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked22.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked23.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked24.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked3.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked4.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked5.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked6.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked7.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked8.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked9.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/gen_Bu
> lkOperation.py
> 
> Modified:
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> eration.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apac
> he/lucene/util/packed/BulkOperation.java?rev=1379479&r1=1379478&r2=137
> 9479&view=diff
> ================================================================
> ==============
> ---
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> eration.java (original)
> +++
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> eration.java Fri Aug 31 15:32:29 2012
> @@ -93,27 +93,27 @@ abstract class BulkOperation implements
> 
>    // NOTE: this is sparse (some entries are null):
>    private static final BulkOperation[] packedSingleBlockBulkOps = new
> BulkOperation[] {
> -    new BulkOperationPackedSingleBlock1(),
> -    new BulkOperationPackedSingleBlock2(),
> -    new BulkOperationPackedSingleBlock3(),
> -    new BulkOperationPackedSingleBlock4(),
> -    new BulkOperationPackedSingleBlock5(),
> -    new BulkOperationPackedSingleBlock6(),
> -    new BulkOperationPackedSingleBlock7(),
> -    new BulkOperationPackedSingleBlock8(),
> -    new BulkOperationPackedSingleBlock9(),
> -    new BulkOperationPackedSingleBlock10(),
> +    new BulkOperationPackedSingleBlock(1),
> +    new BulkOperationPackedSingleBlock(2),
> +    new BulkOperationPackedSingleBlock(3),
> +    new BulkOperationPackedSingleBlock(4),
> +    new BulkOperationPackedSingleBlock(5),
> +    new BulkOperationPackedSingleBlock(6),
> +    new BulkOperationPackedSingleBlock(7),
> +    new BulkOperationPackedSingleBlock(8),
> +    new BulkOperationPackedSingleBlock(9),
> +    new BulkOperationPackedSingleBlock(10),
>      null,
> -    new BulkOperationPackedSingleBlock12(),
> +    new BulkOperationPackedSingleBlock(12),
>      null,
>      null,
>      null,
> -    new BulkOperationPackedSingleBlock16(),
> +    new BulkOperationPackedSingleBlock(16),
>      null,
>      null,
>      null,
>      null,
> -    new BulkOperationPackedSingleBlock21(),
> +    new BulkOperationPackedSingleBlock(21),
>      null,
>      null,
>      null,
> 
> Modified:
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked1.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apac
> he/lucene/util/packed/BulkOperationPacked1.java?rev=1379479&r1=1379478
> &r2=1379479&view=diff
> ================================================================
> ==============
> ---
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked1.java (original)
> +++
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked1.java Fri Aug 31 15:32:29 2012
> @@ -24,316 +24,60 @@ package org.apache.lucene.util.packed;
>   */
>  final class BulkOperationPacked1 extends BulkOperationPacked {
> 
> -    public BulkOperationPacked1() {
> -      super(1);
> -      assert blockCount() == 1;
> -      assert valueCount() == 64;
> -    }
> -
> -    @Override
> -    public void decode(long[] blocks, int blocksOffset, int[] values, int
> valuesOffset, int iterations) {
> -      assert blocksOffset + iterations * blockCount() <= blocks.length;
> -      assert valuesOffset + iterations * valueCount() <= values.length;
> -      for (int i = 0; i < iterations; ++i) {
> -        final long block0 = blocks[blocksOffset++];
> -        values[valuesOffset++] = (int) (block0 >>> 63);
> -        values[valuesOffset++] = (int) ((block0 >>> 62) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 61) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 60) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 59) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 58) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 57) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 56) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 55) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 54) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 53) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 52) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 51) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 50) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 49) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 48) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 47) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 46) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 45) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 44) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 43) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 42) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 41) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 40) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 39) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 38) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 37) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 36) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 35) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 34) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 33) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 32) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 31) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 30) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 29) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 28) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 27) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 26) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 25) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 24) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 23) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 22) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 21) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 20) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 19) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 18) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 17) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 16) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 15) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 14) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 13) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 12) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 11) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 10) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 9) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 8) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 7) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 6) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 5) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 4) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 3) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 2) & 1L);
> -        values[valuesOffset++] = (int) ((block0 >>> 1) & 1L);
> -        values[valuesOffset++] = (int) (block0 & 1L);
> +  public BulkOperationPacked1() {
> +    super(1);
> +    assert blockCount() == 1;
> +    assert valueCount() == 64;
> +  }
> +
> +  @Override
> +  public void decode(long[] blocks, int blocksOffset, int[] values, int
> valuesOffset, int iterations) {
> +    for (int i = 0; i < iterations; ++i) {
> +      final long block = blocks[blocksOffset++];
> +      for (int shift = 63; shift >= 0; shift -= 1) {
> +        values[valuesOffset++] = (int) ((block >>> shift) & 1);
>        }
>      }
> +  }
> 
> -    @Override
> -    public void decode(byte[] blocks, int blocksOffset, int[] values, int
> valuesOffset, int iterations) {
> -      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
> -      assert valuesOffset + iterations * valueCount() <= values.length;
> -      for (int i = 0; i < iterations; ++i) {
> -        final int byte0 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte0 >>> 7;
> -        values[valuesOffset++] = (byte0 >>> 6) & 1;
> -        values[valuesOffset++] = (byte0 >>> 5) & 1;
> -        values[valuesOffset++] = (byte0 >>> 4) & 1;
> -        values[valuesOffset++] = (byte0 >>> 3) & 1;
> -        values[valuesOffset++] = (byte0 >>> 2) & 1;
> -        values[valuesOffset++] = (byte0 >>> 1) & 1;
> -        values[valuesOffset++] = byte0 & 1;
> -        final int byte1 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte1 >>> 7;
> -        values[valuesOffset++] = (byte1 >>> 6) & 1;
> -        values[valuesOffset++] = (byte1 >>> 5) & 1;
> -        values[valuesOffset++] = (byte1 >>> 4) & 1;
> -        values[valuesOffset++] = (byte1 >>> 3) & 1;
> -        values[valuesOffset++] = (byte1 >>> 2) & 1;
> -        values[valuesOffset++] = (byte1 >>> 1) & 1;
> -        values[valuesOffset++] = byte1 & 1;
> -        final int byte2 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte2 >>> 7;
> -        values[valuesOffset++] = (byte2 >>> 6) & 1;
> -        values[valuesOffset++] = (byte2 >>> 5) & 1;
> -        values[valuesOffset++] = (byte2 >>> 4) & 1;
> -        values[valuesOffset++] = (byte2 >>> 3) & 1;
> -        values[valuesOffset++] = (byte2 >>> 2) & 1;
> -        values[valuesOffset++] = (byte2 >>> 1) & 1;
> -        values[valuesOffset++] = byte2 & 1;
> -        final int byte3 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte3 >>> 7;
> -        values[valuesOffset++] = (byte3 >>> 6) & 1;
> -        values[valuesOffset++] = (byte3 >>> 5) & 1;
> -        values[valuesOffset++] = (byte3 >>> 4) & 1;
> -        values[valuesOffset++] = (byte3 >>> 3) & 1;
> -        values[valuesOffset++] = (byte3 >>> 2) & 1;
> -        values[valuesOffset++] = (byte3 >>> 1) & 1;
> -        values[valuesOffset++] = byte3 & 1;
> -        final int byte4 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte4 >>> 7;
> -        values[valuesOffset++] = (byte4 >>> 6) & 1;
> -        values[valuesOffset++] = (byte4 >>> 5) & 1;
> -        values[valuesOffset++] = (byte4 >>> 4) & 1;
> -        values[valuesOffset++] = (byte4 >>> 3) & 1;
> -        values[valuesOffset++] = (byte4 >>> 2) & 1;
> -        values[valuesOffset++] = (byte4 >>> 1) & 1;
> -        values[valuesOffset++] = byte4 & 1;
> -        final int byte5 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte5 >>> 7;
> -        values[valuesOffset++] = (byte5 >>> 6) & 1;
> -        values[valuesOffset++] = (byte5 >>> 5) & 1;
> -        values[valuesOffset++] = (byte5 >>> 4) & 1;
> -        values[valuesOffset++] = (byte5 >>> 3) & 1;
> -        values[valuesOffset++] = (byte5 >>> 2) & 1;
> -        values[valuesOffset++] = (byte5 >>> 1) & 1;
> -        values[valuesOffset++] = byte5 & 1;
> -        final int byte6 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte6 >>> 7;
> -        values[valuesOffset++] = (byte6 >>> 6) & 1;
> -        values[valuesOffset++] = (byte6 >>> 5) & 1;
> -        values[valuesOffset++] = (byte6 >>> 4) & 1;
> -        values[valuesOffset++] = (byte6 >>> 3) & 1;
> -        values[valuesOffset++] = (byte6 >>> 2) & 1;
> -        values[valuesOffset++] = (byte6 >>> 1) & 1;
> -        values[valuesOffset++] = byte6 & 1;
> -        final int byte7 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte7 >>> 7;
> -        values[valuesOffset++] = (byte7 >>> 6) & 1;
> -        values[valuesOffset++] = (byte7 >>> 5) & 1;
> -        values[valuesOffset++] = (byte7 >>> 4) & 1;
> -        values[valuesOffset++] = (byte7 >>> 3) & 1;
> -        values[valuesOffset++] = (byte7 >>> 2) & 1;
> -        values[valuesOffset++] = (byte7 >>> 1) & 1;
> -        values[valuesOffset++] = byte7 & 1;
> -      }
> +  @Override
> +  public void decode(byte[] blocks, int blocksOffset, int[] values, int
> valuesOffset, int iterations) {
> +    for (int j = 0; j < 8 * iterations; ++j) {
> +      final byte block = blocks[blocksOffset++];
> +      values[valuesOffset++] = (block >>> 7) & 1;
> +      values[valuesOffset++] = (block >>> 6) & 1;
> +      values[valuesOffset++] = (block >>> 5) & 1;
> +      values[valuesOffset++] = (block >>> 4) & 1;
> +      values[valuesOffset++] = (block >>> 3) & 1;
> +      values[valuesOffset++] = (block >>> 2) & 1;
> +      values[valuesOffset++] = (block >>> 1) & 1;
> +      values[valuesOffset++] = block & 1;
>      }
> +  }
> 
> -    @Override
> -    public void decode(long[] blocks, int blocksOffset, long[] values, int
> valuesOffset, int iterations) {
> -      assert blocksOffset + iterations * blockCount() <= blocks.length;
> -      assert valuesOffset + iterations * valueCount() <= values.length;
> -      for (int i = 0; i < iterations; ++i) {
> -        final long block0 = blocks[blocksOffset++];
> -        values[valuesOffset++] = block0 >>> 63;
> -        values[valuesOffset++] = (block0 >>> 62) & 1L;
> -        values[valuesOffset++] = (block0 >>> 61) & 1L;
> -        values[valuesOffset++] = (block0 >>> 60) & 1L;
> -        values[valuesOffset++] = (block0 >>> 59) & 1L;
> -        values[valuesOffset++] = (block0 >>> 58) & 1L;
> -        values[valuesOffset++] = (block0 >>> 57) & 1L;
> -        values[valuesOffset++] = (block0 >>> 56) & 1L;
> -        values[valuesOffset++] = (block0 >>> 55) & 1L;
> -        values[valuesOffset++] = (block0 >>> 54) & 1L;
> -        values[valuesOffset++] = (block0 >>> 53) & 1L;
> -        values[valuesOffset++] = (block0 >>> 52) & 1L;
> -        values[valuesOffset++] = (block0 >>> 51) & 1L;
> -        values[valuesOffset++] = (block0 >>> 50) & 1L;
> -        values[valuesOffset++] = (block0 >>> 49) & 1L;
> -        values[valuesOffset++] = (block0 >>> 48) & 1L;
> -        values[valuesOffset++] = (block0 >>> 47) & 1L;
> -        values[valuesOffset++] = (block0 >>> 46) & 1L;
> -        values[valuesOffset++] = (block0 >>> 45) & 1L;
> -        values[valuesOffset++] = (block0 >>> 44) & 1L;
> -        values[valuesOffset++] = (block0 >>> 43) & 1L;
> -        values[valuesOffset++] = (block0 >>> 42) & 1L;
> -        values[valuesOffset++] = (block0 >>> 41) & 1L;
> -        values[valuesOffset++] = (block0 >>> 40) & 1L;
> -        values[valuesOffset++] = (block0 >>> 39) & 1L;
> -        values[valuesOffset++] = (block0 >>> 38) & 1L;
> -        values[valuesOffset++] = (block0 >>> 37) & 1L;
> -        values[valuesOffset++] = (block0 >>> 36) & 1L;
> -        values[valuesOffset++] = (block0 >>> 35) & 1L;
> -        values[valuesOffset++] = (block0 >>> 34) & 1L;
> -        values[valuesOffset++] = (block0 >>> 33) & 1L;
> -        values[valuesOffset++] = (block0 >>> 32) & 1L;
> -        values[valuesOffset++] = (block0 >>> 31) & 1L;
> -        values[valuesOffset++] = (block0 >>> 30) & 1L;
> -        values[valuesOffset++] = (block0 >>> 29) & 1L;
> -        values[valuesOffset++] = (block0 >>> 28) & 1L;
> -        values[valuesOffset++] = (block0 >>> 27) & 1L;
> -        values[valuesOffset++] = (block0 >>> 26) & 1L;
> -        values[valuesOffset++] = (block0 >>> 25) & 1L;
> -        values[valuesOffset++] = (block0 >>> 24) & 1L;
> -        values[valuesOffset++] = (block0 >>> 23) & 1L;
> -        values[valuesOffset++] = (block0 >>> 22) & 1L;
> -        values[valuesOffset++] = (block0 >>> 21) & 1L;
> -        values[valuesOffset++] = (block0 >>> 20) & 1L;
> -        values[valuesOffset++] = (block0 >>> 19) & 1L;
> -        values[valuesOffset++] = (block0 >>> 18) & 1L;
> -        values[valuesOffset++] = (block0 >>> 17) & 1L;
> -        values[valuesOffset++] = (block0 >>> 16) & 1L;
> -        values[valuesOffset++] = (block0 >>> 15) & 1L;
> -        values[valuesOffset++] = (block0 >>> 14) & 1L;
> -        values[valuesOffset++] = (block0 >>> 13) & 1L;
> -        values[valuesOffset++] = (block0 >>> 12) & 1L;
> -        values[valuesOffset++] = (block0 >>> 11) & 1L;
> -        values[valuesOffset++] = (block0 >>> 10) & 1L;
> -        values[valuesOffset++] = (block0 >>> 9) & 1L;
> -        values[valuesOffset++] = (block0 >>> 8) & 1L;
> -        values[valuesOffset++] = (block0 >>> 7) & 1L;
> -        values[valuesOffset++] = (block0 >>> 6) & 1L;
> -        values[valuesOffset++] = (block0 >>> 5) & 1L;
> -        values[valuesOffset++] = (block0 >>> 4) & 1L;
> -        values[valuesOffset++] = (block0 >>> 3) & 1L;
> -        values[valuesOffset++] = (block0 >>> 2) & 1L;
> -        values[valuesOffset++] = (block0 >>> 1) & 1L;
> -        values[valuesOffset++] = block0 & 1L;
> +  @Override
> +  public void decode(long[] blocks, int blocksOffset, long[] values, int
> valuesOffset, int iterations) {
> +    for (int i = 0; i < iterations; ++i) {
> +      final long block = blocks[blocksOffset++];
> +      for (int shift = 63; shift >= 0; shift -= 1) {
> +        values[valuesOffset++] = (block >>> shift) & 1;
>        }
>      }
> +  }
> 
> -    @Override
> -    public void decode(byte[] blocks, int blocksOffset, long[] values, int
> valuesOffset, int iterations) {
> -      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
> -      assert valuesOffset + iterations * valueCount() <= values.length;
> -      for (int i = 0; i < iterations; ++i) {
> -        final long byte0 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte0 >>> 7;
> -        values[valuesOffset++] = (byte0 >>> 6) & 1;
> -        values[valuesOffset++] = (byte0 >>> 5) & 1;
> -        values[valuesOffset++] = (byte0 >>> 4) & 1;
> -        values[valuesOffset++] = (byte0 >>> 3) & 1;
> -        values[valuesOffset++] = (byte0 >>> 2) & 1;
> -        values[valuesOffset++] = (byte0 >>> 1) & 1;
> -        values[valuesOffset++] = byte0 & 1;
> -        final long byte1 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte1 >>> 7;
> -        values[valuesOffset++] = (byte1 >>> 6) & 1;
> -        values[valuesOffset++] = (byte1 >>> 5) & 1;
> -        values[valuesOffset++] = (byte1 >>> 4) & 1;
> -        values[valuesOffset++] = (byte1 >>> 3) & 1;
> -        values[valuesOffset++] = (byte1 >>> 2) & 1;
> -        values[valuesOffset++] = (byte1 >>> 1) & 1;
> -        values[valuesOffset++] = byte1 & 1;
> -        final long byte2 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte2 >>> 7;
> -        values[valuesOffset++] = (byte2 >>> 6) & 1;
> -        values[valuesOffset++] = (byte2 >>> 5) & 1;
> -        values[valuesOffset++] = (byte2 >>> 4) & 1;
> -        values[valuesOffset++] = (byte2 >>> 3) & 1;
> -        values[valuesOffset++] = (byte2 >>> 2) & 1;
> -        values[valuesOffset++] = (byte2 >>> 1) & 1;
> -        values[valuesOffset++] = byte2 & 1;
> -        final long byte3 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte3 >>> 7;
> -        values[valuesOffset++] = (byte3 >>> 6) & 1;
> -        values[valuesOffset++] = (byte3 >>> 5) & 1;
> -        values[valuesOffset++] = (byte3 >>> 4) & 1;
> -        values[valuesOffset++] = (byte3 >>> 3) & 1;
> -        values[valuesOffset++] = (byte3 >>> 2) & 1;
> -        values[valuesOffset++] = (byte3 >>> 1) & 1;
> -        values[valuesOffset++] = byte3 & 1;
> -        final long byte4 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte4 >>> 7;
> -        values[valuesOffset++] = (byte4 >>> 6) & 1;
> -        values[valuesOffset++] = (byte4 >>> 5) & 1;
> -        values[valuesOffset++] = (byte4 >>> 4) & 1;
> -        values[valuesOffset++] = (byte4 >>> 3) & 1;
> -        values[valuesOffset++] = (byte4 >>> 2) & 1;
> -        values[valuesOffset++] = (byte4 >>> 1) & 1;
> -        values[valuesOffset++] = byte4 & 1;
> -        final long byte5 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte5 >>> 7;
> -        values[valuesOffset++] = (byte5 >>> 6) & 1;
> -        values[valuesOffset++] = (byte5 >>> 5) & 1;
> -        values[valuesOffset++] = (byte5 >>> 4) & 1;
> -        values[valuesOffset++] = (byte5 >>> 3) & 1;
> -        values[valuesOffset++] = (byte5 >>> 2) & 1;
> -        values[valuesOffset++] = (byte5 >>> 1) & 1;
> -        values[valuesOffset++] = byte5 & 1;
> -        final long byte6 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte6 >>> 7;
> -        values[valuesOffset++] = (byte6 >>> 6) & 1;
> -        values[valuesOffset++] = (byte6 >>> 5) & 1;
> -        values[valuesOffset++] = (byte6 >>> 4) & 1;
> -        values[valuesOffset++] = (byte6 >>> 3) & 1;
> -        values[valuesOffset++] = (byte6 >>> 2) & 1;
> -        values[valuesOffset++] = (byte6 >>> 1) & 1;
> -        values[valuesOffset++] = byte6 & 1;
> -        final long byte7 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = byte7 >>> 7;
> -        values[valuesOffset++] = (byte7 >>> 6) & 1;
> -        values[valuesOffset++] = (byte7 >>> 5) & 1;
> -        values[valuesOffset++] = (byte7 >>> 4) & 1;
> -        values[valuesOffset++] = (byte7 >>> 3) & 1;
> -        values[valuesOffset++] = (byte7 >>> 2) & 1;
> -        values[valuesOffset++] = (byte7 >>> 1) & 1;
> -        values[valuesOffset++] = byte7 & 1;
> -      }
> +  @Override
> +  public void decode(byte[] blocks, int blocksOffset, long[] values, int
> valuesOffset, int iterations) {
> +    for (int j = 0; j < 8 * iterations; ++j) {
> +      final byte block = blocks[blocksOffset++];
> +      values[valuesOffset++] = (block >>> 7) & 1;
> +      values[valuesOffset++] = (block >>> 6) & 1;
> +      values[valuesOffset++] = (block >>> 5) & 1;
> +      values[valuesOffset++] = (block >>> 4) & 1;
> +      values[valuesOffset++] = (block >>> 3) & 1;
> +      values[valuesOffset++] = (block >>> 2) & 1;
> +      values[valuesOffset++] = (block >>> 1) & 1;
> +      values[valuesOffset++] = block & 1;
>      }
> +  }
> 
>  }
> 
> Modified:
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked10.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apac
> he/lucene/util/packed/BulkOperationPacked10.java?rev=1379479&r1=1379478
> &r2=1379479&view=diff
> ================================================================
> ==============
> ---
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked10.java (original)
> +++
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked10.java Fri Aug 31 15:32:29 2012
> @@ -24,260 +24,126 @@ package org.apache.lucene.util.packed;
>   */
>  final class BulkOperationPacked10 extends BulkOperationPacked {
> 
> -    public BulkOperationPacked10() {
> -      super(10);
> -      assert blockCount() == 5;
> -      assert valueCount() == 32;
> +  public BulkOperationPacked10() {
> +    super(10);
> +    assert blockCount() == 5;
> +    assert valueCount() == 32;
> +  }
> +
> +  @Override
> +  public void decode(long[] blocks, int blocksOffset, int[] values, int
> valuesOffset, int iterations) {
> +    for (int i = 0; i < iterations; ++i) {
> +      final long block0 = blocks[blocksOffset++];
> +      values[valuesOffset++] = (int) (block0 >>> 54);
> +      values[valuesOffset++] = (int) ((block0 >>> 44) & 1023L);
> +      values[valuesOffset++] = (int) ((block0 >>> 34) & 1023L);
> +      values[valuesOffset++] = (int) ((block0 >>> 24) & 1023L);
> +      values[valuesOffset++] = (int) ((block0 >>> 14) & 1023L);
> +      values[valuesOffset++] = (int) ((block0 >>> 4) & 1023L);
> +      final long block1 = blocks[blocksOffset++];
> +      values[valuesOffset++] = (int) (((block0 & 15L) << 6) | (block1 >>> 58));
> +      values[valuesOffset++] = (int) ((block1 >>> 48) & 1023L);
> +      values[valuesOffset++] = (int) ((block1 >>> 38) & 1023L);
> +      values[valuesOffset++] = (int) ((block1 >>> 28) & 1023L);
> +      values[valuesOffset++] = (int) ((block1 >>> 18) & 1023L);
> +      values[valuesOffset++] = (int) ((block1 >>> 8) & 1023L);
> +      final long block2 = blocks[blocksOffset++];
> +      values[valuesOffset++] = (int) (((block1 & 255L) << 2) | (block2 >>> 62));
> +      values[valuesOffset++] = (int) ((block2 >>> 52) & 1023L);
> +      values[valuesOffset++] = (int) ((block2 >>> 42) & 1023L);
> +      values[valuesOffset++] = (int) ((block2 >>> 32) & 1023L);
> +      values[valuesOffset++] = (int) ((block2 >>> 22) & 1023L);
> +      values[valuesOffset++] = (int) ((block2 >>> 12) & 1023L);
> +      values[valuesOffset++] = (int) ((block2 >>> 2) & 1023L);
> +      final long block3 = blocks[blocksOffset++];
> +      values[valuesOffset++] = (int) (((block2 & 3L) << 8) | (block3 >>> 56));
> +      values[valuesOffset++] = (int) ((block3 >>> 46) & 1023L);
> +      values[valuesOffset++] = (int) ((block3 >>> 36) & 1023L);
> +      values[valuesOffset++] = (int) ((block3 >>> 26) & 1023L);
> +      values[valuesOffset++] = (int) ((block3 >>> 16) & 1023L);
> +      values[valuesOffset++] = (int) ((block3 >>> 6) & 1023L);
> +      final long block4 = blocks[blocksOffset++];
> +      values[valuesOffset++] = (int) (((block3 & 63L) << 4) | (block4 >>> 60));
> +      values[valuesOffset++] = (int) ((block4 >>> 50) & 1023L);
> +      values[valuesOffset++] = (int) ((block4 >>> 40) & 1023L);
> +      values[valuesOffset++] = (int) ((block4 >>> 30) & 1023L);
> +      values[valuesOffset++] = (int) ((block4 >>> 20) & 1023L);
> +      values[valuesOffset++] = (int) ((block4 >>> 10) & 1023L);
> +      values[valuesOffset++] = (int) (block4 & 1023L);
>      }
> +  }
> 
> -    @Override
> -    public void decode(long[] blocks, int blocksOffset, int[] values, int
> valuesOffset, int iterations) {
> -      assert blocksOffset + iterations * blockCount() <= blocks.length;
> -      assert valuesOffset + iterations * valueCount() <= values.length;
> -      for (int i = 0; i < iterations; ++i) {
> -        final long block0 = blocks[blocksOffset++];
> -        values[valuesOffset++] = (int) (block0 >>> 54);
> -        values[valuesOffset++] = (int) ((block0 >>> 44) & 1023L);
> -        values[valuesOffset++] = (int) ((block0 >>> 34) & 1023L);
> -        values[valuesOffset++] = (int) ((block0 >>> 24) & 1023L);
> -        values[valuesOffset++] = (int) ((block0 >>> 14) & 1023L);
> -        values[valuesOffset++] = (int) ((block0 >>> 4) & 1023L);
> -        final long block1 = blocks[blocksOffset++];
> -        values[valuesOffset++] = (int) (((block0 & 15L) << 6) | (block1 >>> 58));
> -        values[valuesOffset++] = (int) ((block1 >>> 48) & 1023L);
> -        values[valuesOffset++] = (int) ((block1 >>> 38) & 1023L);
> -        values[valuesOffset++] = (int) ((block1 >>> 28) & 1023L);
> -        values[valuesOffset++] = (int) ((block1 >>> 18) & 1023L);
> -        values[valuesOffset++] = (int) ((block1 >>> 8) & 1023L);
> -        final long block2 = blocks[blocksOffset++];
> -        values[valuesOffset++] = (int) (((block1 & 255L) << 2) | (block2 >>> 62));
> -        values[valuesOffset++] = (int) ((block2 >>> 52) & 1023L);
> -        values[valuesOffset++] = (int) ((block2 >>> 42) & 1023L);
> -        values[valuesOffset++] = (int) ((block2 >>> 32) & 1023L);
> -        values[valuesOffset++] = (int) ((block2 >>> 22) & 1023L);
> -        values[valuesOffset++] = (int) ((block2 >>> 12) & 1023L);
> -        values[valuesOffset++] = (int) ((block2 >>> 2) & 1023L);
> -        final long block3 = blocks[blocksOffset++];
> -        values[valuesOffset++] = (int) (((block2 & 3L) << 8) | (block3 >>> 56));
> -        values[valuesOffset++] = (int) ((block3 >>> 46) & 1023L);
> -        values[valuesOffset++] = (int) ((block3 >>> 36) & 1023L);
> -        values[valuesOffset++] = (int) ((block3 >>> 26) & 1023L);
> -        values[valuesOffset++] = (int) ((block3 >>> 16) & 1023L);
> -        values[valuesOffset++] = (int) ((block3 >>> 6) & 1023L);
> -        final long block4 = blocks[blocksOffset++];
> -        values[valuesOffset++] = (int) (((block3 & 63L) << 4) | (block4 >>> 60));
> -        values[valuesOffset++] = (int) ((block4 >>> 50) & 1023L);
> -        values[valuesOffset++] = (int) ((block4 >>> 40) & 1023L);
> -        values[valuesOffset++] = (int) ((block4 >>> 30) & 1023L);
> -        values[valuesOffset++] = (int) ((block4 >>> 20) & 1023L);
> -        values[valuesOffset++] = (int) ((block4 >>> 10) & 1023L);
> -        values[valuesOffset++] = (int) (block4 & 1023L);
> -      }
> +  @Override
> +  public void decode(byte[] blocks, int blocksOffset, int[] values, int
> valuesOffset, int iterations) {
> +    for (int i = 0; i < 8 * iterations; ++i) {
> +      final int byte0 = blocks[blocksOffset++] & 0xFF;
> +      final int byte1 = blocks[blocksOffset++] & 0xFF;
> +      values[valuesOffset++] = (byte0 << 2) | (byte1 >>> 6);
> +      final int byte2 = blocks[blocksOffset++] & 0xFF;
> +      values[valuesOffset++] = ((byte1 & 63) << 4) | (byte2 >>> 4);
> +      final int byte3 = blocks[blocksOffset++] & 0xFF;
> +      values[valuesOffset++] = ((byte2 & 15) << 6) | (byte3 >>> 2);
> +      final int byte4 = blocks[blocksOffset++] & 0xFF;
> +      values[valuesOffset++] = ((byte3 & 3) << 8) | byte4;
>      }
> +  }
> 
> -    @Override
> -    public void decode(byte[] blocks, int blocksOffset, int[] values, int
> valuesOffset, int iterations) {
> -      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
> -      assert valuesOffset + iterations * valueCount() <= values.length;
> -      for (int i = 0; i < iterations; ++i) {
> -        final int byte0 = blocks[blocksOffset++] & 0xFF;
> -        final int byte1 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte0 << 2) | (byte1 >>> 6);
> -        final int byte2 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte1 & 63) << 4) | (byte2 >>> 4);
> -        final int byte3 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte2 & 15) << 6) | (byte3 >>> 2);
> -        final int byte4 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte3 & 3) << 8) | byte4;
> -        final int byte5 = blocks[blocksOffset++] & 0xFF;
> -        final int byte6 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte5 << 2) | (byte6 >>> 6);
> -        final int byte7 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte6 & 63) << 4) | (byte7 >>> 4);
> -        final int byte8 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte7 & 15) << 6) | (byte8 >>> 2);
> -        final int byte9 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte8 & 3) << 8) | byte9;
> -        final int byte10 = blocks[blocksOffset++] & 0xFF;
> -        final int byte11 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte10 << 2) | (byte11 >>> 6);
> -        final int byte12 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte11 & 63) << 4) | (byte12 >>> 4);
> -        final int byte13 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte12 & 15) << 6) | (byte13 >>> 2);
> -        final int byte14 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte13 & 3) << 8) | byte14;
> -        final int byte15 = blocks[blocksOffset++] & 0xFF;
> -        final int byte16 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte15 << 2) | (byte16 >>> 6);
> -        final int byte17 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte16 & 63) << 4) | (byte17 >>> 4);
> -        final int byte18 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte17 & 15) << 6) | (byte18 >>> 2);
> -        final int byte19 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte18 & 3) << 8) | byte19;
> -        final int byte20 = blocks[blocksOffset++] & 0xFF;
> -        final int byte21 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte20 << 2) | (byte21 >>> 6);
> -        final int byte22 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte21 & 63) << 4) | (byte22 >>> 4);
> -        final int byte23 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte22 & 15) << 6) | (byte23 >>> 2);
> -        final int byte24 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte23 & 3) << 8) | byte24;
> -        final int byte25 = blocks[blocksOffset++] & 0xFF;
> -        final int byte26 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte25 << 2) | (byte26 >>> 6);
> -        final int byte27 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte26 & 63) << 4) | (byte27 >>> 4);
> -        final int byte28 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte27 & 15) << 6) | (byte28 >>> 2);
> -        final int byte29 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte28 & 3) << 8) | byte29;
> -        final int byte30 = blocks[blocksOffset++] & 0xFF;
> -        final int byte31 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte30 << 2) | (byte31 >>> 6);
> -        final int byte32 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte31 & 63) << 4) | (byte32 >>> 4);
> -        final int byte33 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte32 & 15) << 6) | (byte33 >>> 2);
> -        final int byte34 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte33 & 3) << 8) | byte34;
> -        final int byte35 = blocks[blocksOffset++] & 0xFF;
> -        final int byte36 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte35 << 2) | (byte36 >>> 6);
> -        final int byte37 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte36 & 63) << 4) | (byte37 >>> 4);
> -        final int byte38 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte37 & 15) << 6) | (byte38 >>> 2);
> -        final int byte39 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte38 & 3) << 8) | byte39;
> -      }
> +  @Override
> +  public void decode(long[] blocks, int blocksOffset, long[] values, int
> valuesOffset, int iterations) {
> +    for (int i = 0; i < iterations; ++i) {
> +      final long block0 = blocks[blocksOffset++];
> +      values[valuesOffset++] = block0 >>> 54;
> +      values[valuesOffset++] = (block0 >>> 44) & 1023L;
> +      values[valuesOffset++] = (block0 >>> 34) & 1023L;
> +      values[valuesOffset++] = (block0 >>> 24) & 1023L;
> +      values[valuesOffset++] = (block0 >>> 14) & 1023L;
> +      values[valuesOffset++] = (block0 >>> 4) & 1023L;
> +      final long block1 = blocks[blocksOffset++];
> +      values[valuesOffset++] = ((block0 & 15L) << 6) | (block1 >>> 58);
> +      values[valuesOffset++] = (block1 >>> 48) & 1023L;
> +      values[valuesOffset++] = (block1 >>> 38) & 1023L;
> +      values[valuesOffset++] = (block1 >>> 28) & 1023L;
> +      values[valuesOffset++] = (block1 >>> 18) & 1023L;
> +      values[valuesOffset++] = (block1 >>> 8) & 1023L;
> +      final long block2 = blocks[blocksOffset++];
> +      values[valuesOffset++] = ((block1 & 255L) << 2) | (block2 >>> 62);
> +      values[valuesOffset++] = (block2 >>> 52) & 1023L;
> +      values[valuesOffset++] = (block2 >>> 42) & 1023L;
> +      values[valuesOffset++] = (block2 >>> 32) & 1023L;
> +      values[valuesOffset++] = (block2 >>> 22) & 1023L;
> +      values[valuesOffset++] = (block2 >>> 12) & 1023L;
> +      values[valuesOffset++] = (block2 >>> 2) & 1023L;
> +      final long block3 = blocks[blocksOffset++];
> +      values[valuesOffset++] = ((block2 & 3L) << 8) | (block3 >>> 56);
> +      values[valuesOffset++] = (block3 >>> 46) & 1023L;
> +      values[valuesOffset++] = (block3 >>> 36) & 1023L;
> +      values[valuesOffset++] = (block3 >>> 26) & 1023L;
> +      values[valuesOffset++] = (block3 >>> 16) & 1023L;
> +      values[valuesOffset++] = (block3 >>> 6) & 1023L;
> +      final long block4 = blocks[blocksOffset++];
> +      values[valuesOffset++] = ((block3 & 63L) << 4) | (block4 >>> 60);
> +      values[valuesOffset++] = (block4 >>> 50) & 1023L;
> +      values[valuesOffset++] = (block4 >>> 40) & 1023L;
> +      values[valuesOffset++] = (block4 >>> 30) & 1023L;
> +      values[valuesOffset++] = (block4 >>> 20) & 1023L;
> +      values[valuesOffset++] = (block4 >>> 10) & 1023L;
> +      values[valuesOffset++] = block4 & 1023L;
>      }
> +  }
> 
> -    @Override
> -    public void decode(long[] blocks, int blocksOffset, long[] values, int
> valuesOffset, int iterations) {
> -      assert blocksOffset + iterations * blockCount() <= blocks.length;
> -      assert valuesOffset + iterations * valueCount() <= values.length;
> -      for (int i = 0; i < iterations; ++i) {
> -        final long block0 = blocks[blocksOffset++];
> -        values[valuesOffset++] = block0 >>> 54;
> -        values[valuesOffset++] = (block0 >>> 44) & 1023L;
> -        values[valuesOffset++] = (block0 >>> 34) & 1023L;
> -        values[valuesOffset++] = (block0 >>> 24) & 1023L;
> -        values[valuesOffset++] = (block0 >>> 14) & 1023L;
> -        values[valuesOffset++] = (block0 >>> 4) & 1023L;
> -        final long block1 = blocks[blocksOffset++];
> -        values[valuesOffset++] = ((block0 & 15L) << 6) | (block1 >>> 58);
> -        values[valuesOffset++] = (block1 >>> 48) & 1023L;
> -        values[valuesOffset++] = (block1 >>> 38) & 1023L;
> -        values[valuesOffset++] = (block1 >>> 28) & 1023L;
> -        values[valuesOffset++] = (block1 >>> 18) & 1023L;
> -        values[valuesOffset++] = (block1 >>> 8) & 1023L;
> -        final long block2 = blocks[blocksOffset++];
> -        values[valuesOffset++] = ((block1 & 255L) << 2) | (block2 >>> 62);
> -        values[valuesOffset++] = (block2 >>> 52) & 1023L;
> -        values[valuesOffset++] = (block2 >>> 42) & 1023L;
> -        values[valuesOffset++] = (block2 >>> 32) & 1023L;
> -        values[valuesOffset++] = (block2 >>> 22) & 1023L;
> -        values[valuesOffset++] = (block2 >>> 12) & 1023L;
> -        values[valuesOffset++] = (block2 >>> 2) & 1023L;
> -        final long block3 = blocks[blocksOffset++];
> -        values[valuesOffset++] = ((block2 & 3L) << 8) | (block3 >>> 56);
> -        values[valuesOffset++] = (block3 >>> 46) & 1023L;
> -        values[valuesOffset++] = (block3 >>> 36) & 1023L;
> -        values[valuesOffset++] = (block3 >>> 26) & 1023L;
> -        values[valuesOffset++] = (block3 >>> 16) & 1023L;
> -        values[valuesOffset++] = (block3 >>> 6) & 1023L;
> -        final long block4 = blocks[blocksOffset++];
> -        values[valuesOffset++] = ((block3 & 63L) << 4) | (block4 >>> 60);
> -        values[valuesOffset++] = (block4 >>> 50) & 1023L;
> -        values[valuesOffset++] = (block4 >>> 40) & 1023L;
> -        values[valuesOffset++] = (block4 >>> 30) & 1023L;
> -        values[valuesOffset++] = (block4 >>> 20) & 1023L;
> -        values[valuesOffset++] = (block4 >>> 10) & 1023L;
> -        values[valuesOffset++] = block4 & 1023L;
> -      }
> -    }
> -
> -    @Override
> -    public void decode(byte[] blocks, int blocksOffset, long[] values, int
> valuesOffset, int iterations) {
> -      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
> -      assert valuesOffset + iterations * valueCount() <= values.length;
> -      for (int i = 0; i < iterations; ++i) {
> -        final long byte0 = blocks[blocksOffset++] & 0xFF;
> -        final long byte1 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte0 << 2) | (byte1 >>> 6);
> -        final long byte2 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte1 & 63) << 4) | (byte2 >>> 4);
> -        final long byte3 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte2 & 15) << 6) | (byte3 >>> 2);
> -        final long byte4 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte3 & 3) << 8) | byte4;
> -        final long byte5 = blocks[blocksOffset++] & 0xFF;
> -        final long byte6 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte5 << 2) | (byte6 >>> 6);
> -        final long byte7 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte6 & 63) << 4) | (byte7 >>> 4);
> -        final long byte8 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte7 & 15) << 6) | (byte8 >>> 2);
> -        final long byte9 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte8 & 3) << 8) | byte9;
> -        final long byte10 = blocks[blocksOffset++] & 0xFF;
> -        final long byte11 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte10 << 2) | (byte11 >>> 6);
> -        final long byte12 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte11 & 63) << 4) | (byte12 >>> 4);
> -        final long byte13 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte12 & 15) << 6) | (byte13 >>> 2);
> -        final long byte14 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte13 & 3) << 8) | byte14;
> -        final long byte15 = blocks[blocksOffset++] & 0xFF;
> -        final long byte16 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte15 << 2) | (byte16 >>> 6);
> -        final long byte17 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte16 & 63) << 4) | (byte17 >>> 4);
> -        final long byte18 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte17 & 15) << 6) | (byte18 >>> 2);
> -        final long byte19 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte18 & 3) << 8) | byte19;
> -        final long byte20 = blocks[blocksOffset++] & 0xFF;
> -        final long byte21 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte20 << 2) | (byte21 >>> 6);
> -        final long byte22 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte21 & 63) << 4) | (byte22 >>> 4);
> -        final long byte23 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte22 & 15) << 6) | (byte23 >>> 2);
> -        final long byte24 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte23 & 3) << 8) | byte24;
> -        final long byte25 = blocks[blocksOffset++] & 0xFF;
> -        final long byte26 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte25 << 2) | (byte26 >>> 6);
> -        final long byte27 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte26 & 63) << 4) | (byte27 >>> 4);
> -        final long byte28 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte27 & 15) << 6) | (byte28 >>> 2);
> -        final long byte29 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte28 & 3) << 8) | byte29;
> -        final long byte30 = blocks[blocksOffset++] & 0xFF;
> -        final long byte31 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte30 << 2) | (byte31 >>> 6);
> -        final long byte32 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte31 & 63) << 4) | (byte32 >>> 4);
> -        final long byte33 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte32 & 15) << 6) | (byte33 >>> 2);
> -        final long byte34 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte33 & 3) << 8) | byte34;
> -        final long byte35 = blocks[blocksOffset++] & 0xFF;
> -        final long byte36 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = (byte35 << 2) | (byte36 >>> 6);
> -        final long byte37 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte36 & 63) << 4) | (byte37 >>> 4);
> -        final long byte38 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte37 & 15) << 6) | (byte38 >>> 2);
> -        final long byte39 = blocks[blocksOffset++] & 0xFF;
> -        values[valuesOffset++] = ((byte38 & 3) << 8) | byte39;
> -      }
> +  @Override
> +  public void decode(byte[] blocks, int blocksOffset, long[] values, int
> valuesOffset, int iterations) {
> +    for (int i = 0; i < 8 * iterations; ++i) {
> +      final long byte0 = blocks[blocksOffset++] & 0xFF;
> +      final long byte1 = blocks[blocksOffset++] & 0xFF;
> +      values[valuesOffset++] = (byte0 << 2) | (byte1 >>> 6);
> +      final long byte2 = blocks[blocksOffset++] & 0xFF;
> +      values[valuesOffset++] = ((byte1 & 63) << 4) | (byte2 >>> 4);
> +      final long byte3 = blocks[blocksOffset++] & 0xFF;
> +      values[valuesOffset++] = ((byte2 & 15) << 6) | (byte3 >>> 2);
> +      final long byte4 = blocks[blocksOffset++] & 0xFF;
> +      values[valuesOffset++] = ((byte3 & 3) << 8) | byte4;
>      }
> +  }
> 
>  }



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


Mime
View raw message