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: r1376305 [1/37] - /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/
Date Thu, 23 Aug 2012 08:36:55 GMT
Hi Mike,

a small suggestion tot he main BulkOperation.java file, this method: "public static BulkOperation
of(PackedInts.Format format, int bitsPerValue)"
I would not use the 2 huge switch statements, instead use 2 arrays (for the 2 main types),
initialize this array like:

BulkOperation [] packedBulkOps = new BulkOperation[] {
	new BulkOperationPacked1(), new BulkOperationPacked2(),new BulkOperationPacked3(),...
}
BulkOperation [] packedSingleBulkOps = new BulkOperation[] {
	new BulkOperationPackedSingleBlock1(), new BulkOperationPackedSingleBlock2(),new BulkOperationPackedSingleBlock3(),...
}

And then do BulkOperation.of() as:
  public static BulkOperation of(PackedInts.Format format, int bitsPerValue) {
    switch (format) {
    case PACKED:
      return packedBulkOps[bitsPerValue-1];
    case PACKED_SINGLE_BLOCK:
      return packedSingleBulkOps[bitsPerValue-1];
    default:
      throw new AssertionError();
    }
  }

Much more compact and faster, because the first switch statement is too big for a tableSwich
(if speed is important).

I would change this, but I have no idea about python - but let me try :-)

Uwe

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

> -----Original Message-----
> From: mikemccand@apache.org [mailto:mikemccand@apache.org]
> Sent: Thursday, August 23, 2012 1:14 AM
> To: commits@lucene.apache.org
> Subject: svn commit: r1376305 [1/37] -
> /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/
> 
> Author: mikemccand
> Date: Wed Aug 22 23:13:40 2012
> New Revision: 1376305
> 
> URL: http://svn.apache.org/viewvc?rev=1376305&view=rev
> Log:
> refactor BulkOperation.java into separate sources
> 
> Added:
> 
> 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
> erationPacked25.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked26.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked27.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked28.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked29.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
> erationPacked30.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked31.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked32.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked33.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked34.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked35.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked36.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked37.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked38.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked39.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
> erationPacked40.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked41.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked42.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked43.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked44.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked45.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked46.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked47.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked48.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked49.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
> erationPacked50.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked51.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked52.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked53.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked54.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked55.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked56.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked57.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked58.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked59.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
> erationPacked60.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked61.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked62.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked63.java
> 
> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/packed/BulkOp
> erationPacked64.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/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
> erationPackedSingleBlock32.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/gen_Bu
> lkOperation.py


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


Mime
View raw message