On Tue, 02 Mar 1999 Artur Biesiadowski <[EMAIL PROTECTED]> wrote:

: Here are few of my ideas about how some classes can be made a lot
: faster. Maybe I'll implement them, but if not I would like to share
: them.
: 
: [...]
:
: java.util.BitSet
: It might be interesting to implement BitSet to use array of ints instead
: of array of longs. Of course sun have created API of bitset heavily
: based on their internal representation - but only serialization and
: hashcode computation would require hackery. Such BitSet would work a lot
: faster on 32-bit CPUs. [...]

This sounded interesting and since its my class, I have implemented this:

http://www.informatik.uni-oldenburg.de/~delwi/classpath/BitSet.java

I have only tested this with the blackdown port of JDK1.2.  This class
uses the new JDK1.2 serialization mechanism (get/putFields) which
aren't implemented in classpath, so serialization can't work there.

:                  [...] I wonder if it would be possible/reasonable to
: distribute two versions - and place one that will work faster for target
: machine (of course both of them would work on very platform).

It would be nice to have a simple preprocessor, so we can conditional
compile this.

Conditional compiling with static final variables doesn't work:

class BitSet {
   if (USE32BIT)
      public transient int[] bits;
   else
      public long[] bits;
}

  Jochen

Reply via email to