A better compressed bitset in Java

Overview

RoaringBitmap

docs-badge Java 8 CI Java 11 CI Java 12 CI Java 13 CI Java 14 CI

Bitsets, also called bitmaps, are commonly used as fast data structures. Unfortunately, they can use too much memory. To compensate, we often use compressed bitmaps.

Roaring bitmaps are compressed bitmaps which tend to outperform conventional compressed bitmaps such as WAH, EWAH or Concise. In some instances, roaring bitmaps can be hundreds of times faster and they often offer significantly better compression. They can even be faster than uncompressed bitmaps.

Roaring bitmaps are found to work well in many important applications:

Use Roaring for bitmap compression whenever possible. Do not use other bitmap compression methods (Wang et al., SIGMOD 2017)

kudos for making something that makes my software run 5x faster (Charles Parker from BigML)

This library is used by

The YouTube SQL Engine, Google Procella, uses Roaring bitmaps for indexing. Apache Lucene uses Roaring bitmaps, though they have their own independent implementation. Derivatives of Lucene such as Solr and Elastic also use Roaring bitmaps. Other platforms such as Whoosh, Microsoft Visual Studio Team Services (VSTS) and Pilosa also use Roaring bitmaps with their own implementations. You find Roaring bitmaps in InfluxDB, Bleve, Cloud Torrent, and so forth.

There is a serialized format specification for interoperability between implementations: https://github.com/RoaringBitmap/RoaringFormatSpec/ We have interoperable C/C++, Java and Go implementations.

(c) 2013-... the RoaringBitmap authors

This code is licensed under Apache License, Version 2.0 (AL2.0).

When should you use a bitmap?

Sets are a fundamental abstraction in software. They can be implemented in various ways, as hash sets, as trees, and so forth. In databases and search engines, sets are often an integral part of indexes. For example, we may need to maintain a set of all documents or rows (represented by numerical identifier) that satisfy some property. Besides adding or removing elements from the set, we need fast functions to compute the intersection, the union, the difference between sets, and so on.

To implement a set of integers, a particularly appealing strategy is the bitmap (also called bitset or bit vector). Using n bits, we can represent any set made of the integers from the range [0,n): the ith bit is set to one if integer i is present in the set. Commodity processors use words of W=32 or W=64 bits. By combining many such words, we can support large values of n. Intersections, unions and differences can then be implemented as bitwise AND, OR and ANDNOT operations. More complicated set functions can also be implemented as bitwise operations.

When the bitset approach is applicable, it can be orders of magnitude faster than other possible implementation of a set (e.g., as a hash set) while using several times less memory.

However, a bitset, even a compressed one is not always applicable. For example, if the you have 1000 random-looking integers, then a simple array might be the best representation. We refer to this case as the "sparse" scenario.

When should you use compressed bitmaps?

An uncompressed BitSet can use a lot of memory. For example, if you take a BitSet and set the bit at position 1,000,000 to true and you have just over 100kB. That is over 100kB to store the position of one bit. This is wasteful even if you do not care about memory: suppose that you need to compute the intersection between this BitSet and another one that has a bit at position 1,000,001 to true, then you need to go through all these zeroes, whether you like it or not. That can become very wasteful.

This being said, there are definitively cases where attempting to use compressed bitmaps is wasteful. For example, if you have a small universe size. E.g., your bitmaps represent sets of integers from [0,n) where n is small (e.g., n=64 or n=128). If you are able to uncompressed BitSet and it does not blow up your memory usage, then compressed bitmaps are probably not useful to you. In fact, if you do not need compression, then a BitSet offers remarkable speed.

The sparse scenario is another use case where compressed bitmaps should not be used. Keep in mind that random-looking data is usually not compressible. E.g., if you have a small set of 32-bit random integers, it is not mathematically possible to use far less than 32 bits per integer, and attempts at compression can be counterproductive.

How does Roaring compares with the alternatives?

Most alternatives to Roaring are part of a larger family of compressed bitmaps that are run-length-encoded bitmaps. They identify long runs of 1s or 0s and they represent them with a marker word. If you have a local mix of 1s and 0, you use an uncompressed word.

There are many formats in this family:

  • Oracle's BBC is an obsolete format at this point: though it may provide good compression, it is likely much slower than more recent alternatives due to excessive branching.
  • WAH is a patented variation on BBC that provides better performance.
  • Concise is a variation on the patented WAH. It some specific instances, it can compress much better than WAH (up to 2x better), but it is generally slower.
  • EWAH is both free of patent, and it is faster than all the above. On the downside, it does not compress quite as well. It is faster because it allows some form of "skipping" over uncompressed words. So though none of these formats are great at random access, EWAH is better than the alternatives.

There is a big problem with these formats however that can hurt you badly in some cases: there is no random access. If you want to check whether a given value is present in the set, you have to start from the beginning and "uncompress" the whole thing. This means that if you want to intersect a big set with a large set, you still have to uncompress the whole big set in the worst case...

Roaring solves this problem. It works in the following manner. It divides the data into chunks of 216 integers (e.g., [0, 216), [216, 2 x 216), ...). Within a chunk, it can use an uncompressed bitmap, a simple list of integers, or a list of runs. Whatever format it uses, they all allow you to check for the present of any one value quickly (e.g., with a binary search). The net result is that Roaring can compute many operations much faster than run-length-encoded formats like WAH, EWAH, Concise... Maybe surprisingly, Roaring also generally offers better compression ratios.

API docs

http://www.javadoc.io/doc/org.roaringbitmap/RoaringBitmap/

Scientific Documentation

  • Daniel Lemire, Owen Kaser, Nathan Kurz, Luca Deri, Chris O'Hara, François Saint-Jacques, Gregory Ssi-Yan-Kai, Roaring Bitmaps: Implementation of an Optimized Software Library, Software: Practice and Experience 48 (4), 2018 arXiv:1709.07821
  • Samy Chambi, Daniel Lemire, Owen Kaser, Robert Godin, Better bitmap performance with Roaring bitmaps, Software: Practice and Experience Volume 46, Issue 5, pages 709–719, May 2016 http://arxiv.org/abs/1402.6407 This paper used data from http://lemire.me/data/realroaring2014.html
  • Daniel Lemire, Gregory Ssi-Yan-Kai, Owen Kaser, Consistently faster and smaller compressed bitmaps with Roaring, Software: Practice and Experience 46 (11), 2016. http://arxiv.org/abs/1603.06549
  • Samy Chambi, Daniel Lemire, Robert Godin, Kamel Boukhalfa, Charles Allen, Fangjin Yang, Optimizing Druid with Roaring bitmaps, IDEAS 2016, 2016. http://r-libre.teluq.ca/950/

Code sample

import org.roaringbitmap.RoaringBitmap;

public class Basic {

  public static void main(String[] args) {
        RoaringBitmap rr = RoaringBitmap.bitmapOf(1,2,3,1000);
        RoaringBitmap rr2 = new RoaringBitmap();
        rr2.add(4000L,4255L);
        rr.select(3); // would return the third value or 1000
        rr.rank(2); // would return the rank of 2, which is index 1
        rr.contains(1000); // will return true
        rr.contains(7); // will return false

        RoaringBitmap rror = RoaringBitmap.or(rr, rr2);// new bitmap
        rr.or(rr2); //in-place computation
        boolean equals = rror.equals(rr);// true
        if(!equals) throw new RuntimeException("bug");
        // number of values stored?
        long cardinality = rr.getLongCardinality();
        System.out.println(cardinality);
        // a "forEach" is faster than this loop, but a loop is possible:
        for(int i : rr) {
          System.out.println(i);
        }
  }
}

Please see the examples folder for more examples, which you can run with ./gradlew :examples:runAll, or run a specific one with ./gradlew :examples:runExampleBitmap64, etc.

Unsigned integers

Java lacks native unsigned integers but integers are still considered to be unsigned within Roaring and ordered according to Integer.compareUnsigned. This means that Java will order the numbers like so 0, 1, ..., 2147483647, -2147483648, -2147483647,..., -1. To interpret correctly, you can use Integer.toUnsignedLong and Integer.toUnsignedString.

Working with memory-mapped bitmaps

If you want to have your bitmaps lie in memory-mapped files, you can use the org.roaringbitmap.buffer package instead. It contains two important classes, ImmutableRoaringBitmap and MutableRoaringBitmap. MutableRoaringBitmaps are derived from ImmutableRoaringBitmap, so that you can convert (cast) a MutableRoaringBitmap to an ImmutableRoaringBitmap in constant time.

An ImmutableRoaringBitmap that is not an instance of a MutableRoaringBitmap is backed by a ByteBuffer which comes with some performance overhead, but with the added flexibility that the data can reside anywhere (including outside of the Java heap).

At times you may need to work with bitmaps that reside on disk (instances of ImmutableRoaringBitmap) and bitmaps that reside in Java memory. If you know that the bitmaps will reside in Java memory, it is best to use MutableRoaringBitmap instances, not only can they be modified, but they will also be faster. Moreover, because MutableRoaringBitmap instances are also ImmutableRoaringBitmap instances, you can write much of your code expecting ImmutableRoaringBitmap.

If you write your code expecting ImmutableRoaringBitmap instances, without attempting to cast the instances, then your objects will be truly immutable. The MutableRoaringBitmap has a convenience method (toImmutableRoaringBitmap) which is a simple cast back to an ImmutableRoaringBitmap instance. From a language design point of view, instances of the ImmutableRoaringBitmap class are immutable only when used as per the interface of the ImmutableRoaringBitmap class. Given that the class is not final, it is possible to modify instances, through other interfaces. Thus we do not take the term "immutable" in a purist manner, but rather in a practical one.

One of our motivations for this design where MutableRoaringBitmap instances can be casted down to ImmutableRoaringBitmap instances is that bitmaps are often large, or used in a context where memory allocations are to be avoided, so we avoid forcing copies. Copies could be expected if one needs to mix and match ImmutableRoaringBitmap and MutableRoaringBitmap instances.

The following code sample illustrates how to create an ImmutableRoaringBitmap from a ByteBuffer. In such instances, the constructor only loads the meta-data in RAM while the actual data is accessed from the ByteBuffer on demand.

        import org.roaringbitmap.buffer.*;

        //...

        MutableRoaringBitmap rr1 = MutableRoaringBitmap.bitmapOf(1, 2, 3, 1000);
        MutableRoaringBitmap rr2 = MutableRoaringBitmap.bitmapOf( 2, 3, 1010);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        // If there were runs of consecutive values, you could
        // call rr1.runOptimize(); or rr2.runOptimize(); to improve compression
        rr1.serialize(dos);
        rr2.serialize(dos);
        dos.close();
        ByteBuffer bb = ByteBuffer.wrap(bos.toByteArray());
        ImmutableRoaringBitmap rrback1 = new ImmutableRoaringBitmap(bb);
        bb.position(bb.position() + rrback1.serializedSizeInBytes());
        ImmutableRoaringBitmap rrback2 = new ImmutableRoaringBitmap(bb);

Alternatively, we can serialize directly to a ByteBuffer with the serialize(ByteBuffer) method.

Operations on an ImmutableRoaringBitmap such as and, or, xor, flip, will generate a RoaringBitmap which lies in RAM. As the name suggest, the ImmutableRoaringBitmap itself cannot be modified.

This design was inspired by Druid.

One can find a complete working example in the test file TestMemoryMapping.java.

Note that you should not mix the classes from the org.roaringbitmap package with the classes from the org.roaringbitmap.buffer package. They are incompatible. They serialize to the same output however. The performance of the code in org.roaringbitmap package is generally superior because there is no overhead due to the use of ByteBuffer instances.

Kryo

Many applications use Kryo for serialization/deserialization. One can use Roaring bitmaps with Kryo efficiently thanks to a custom serializer (Kryo 5):

public class RoaringSerializer extends Serializer<RoaringBitmap> {
    @Override
    public void write(Kryo kryo, Output output, RoaringBitmap bitmap) {
        try {
            bitmap.serialize(new KryoDataOutput(output));
        } catch (IOException e) {
            e.printStackTrace();
            throw new RuntimeException();
        }
    }
    @Override
    public RoaringBitmap read(Kryo kryo, Input input, Class<? extends RoaringBitmap> type) {
        RoaringBitmap bitmap = new RoaringBitmap();
        try {
            bitmap.deserialize(new KryoDataInput(input));
        } catch (IOException e) {
            e.printStackTrace();
            throw new RuntimeException();
        }
        return bitmap;
    }

}

64-bit integers (long)

Though Roaring Bitmaps were designed with the 32-bit case in mind, we have extensions to 64-bit integers. We offer two classes for this purpose: Roaring64NavigableMap and Roaring64Bitmap.

The Roaring64NavigableMap relies on a conventional red-black-tree. The keys are 32-bit integers representing the most significant 32~bits of elements whereas the values of the tree are 32-bit Roaring bitmaps. The 32-bit Roaring bitmaps represent the least significant bits of a set of elements.

The newer Roaring64Bitmap approach relies on the ART data structure to hold the key/value pair. The key is made of the most significant 48~bits of elements whereas the values are 16-bit Roaring containers. It is inspired by The Adaptive Radix Tree: ARTful Indexing for Main-Memory Databases by Leis et al. (ICDE '13).

    import org.roaringbitmap.longlong.*;

    
    // first Roaring64NavigableMap
    LongBitmapDataProvider r = Roaring64NavigableMap.bitmapOf(1,2,100,1000);
    r.addLong(1234);
    System.out.println(r.contains(1)); // true
    System.out.println(r.contains(3)); // false
    LongIterator i = r.getLongIterator();
    while(i.hasNext()) System.out.println(i.next());


    // second Roaring64Bitmap
    bitmap1 = new Roaring64Bitmap();
    bitmap2 = new Roaring64Bitmap();
    int k = 1 << 16;
    long i = Long.MAX_VALUE / 2;
    long base = i;
    for (; i < base + 10000; ++i) {
       bitmap1.add(i * k);
       bitmap2.add(i * k);
    }
    b1.and(bitmap2);

Prerequisites

  • Version 0.7.x requires JDK 8 or better
  • Version 0.6.x requires JDK 7 or better
  • Version 0.5.x requires JDK 6 or better

To build the project you need maven (version 3).

Download

You can download releases from github: https://github.com/RoaringBitmap/RoaringBitmap/releases

Maven repository

If your project depends on roaring, you can specify the dependency in the Maven "pom.xml" file:

        <dependencies>
          <dependency>
            <groupId>org.roaringbitmap</groupId>
            <artifactId>RoaringBitmap</artifactId>
            <version>0.9.9</version>
          </dependency>
        </dependencies>

where you should replace the version number by the version you require.

For up-to-date releases, we recommend configuring maven and gradle to depend on the Jitpack repository.

Usage

  • Get java

  • ./gradlew assemble will compile

  • ./gradlew build will compile and run the unit tests

  • ./gradlew test will run the tests

  • ./gradlew :roaringbitmap:test --tests TestIterators.testIndexIterator4 run just the test TestIterators.testIndexIterator4

  • ./gradlew checkstyleMain will check that you abide by the code style and that the code compiles. We enforce a strict style so that there is no debate as to the proper way to format the code.

IntelliJ and Eclipse

If you plan to contribute to RoaringBitmap, you can have load it up in your favorite IDE.

  • For IntelliJ, in the IDE create a new project, possibly from existing sources, choose import, gradle.
  • For Eclipse: File, Import, Existing Gradle Projects, Select RoaringBitmap on my disk

Contributing

Contributions are invited. We enforce the Google Java style. Please run ./gradlew checkstyleMain on your code before submitting a patch.

FAQ

  • I am getting an error about a bad cookie. What is this about?

In the serialized files, part of the first 4 bytes are dedicated to a "cookie" which serves to indicate the file format.

If you try to deserialize or map a bitmap from data that has an unrecognized "cookie", the code will abort the process and report an error.

This problem will occur to all users who serialized Roaring bitmaps using versions prior to 0.4.x as they upgrade to version 0.4.x or better. These users need to refresh their serialized bitmaps.

  • How big can a Roaring bitmap get?

Given N integers in [0,x), then the serialized size in bytes of a Roaring bitmap should never exceed this bound:

8 + 9 * ((long)x+65535)/65536 + 2 * N

That is, given a fixed overhead for the universe size (x), Roaring bitmaps never use more than 2 bytes per integer. You can call RoaringBitmap.maximumSerializedSize for a more precise estimate.

  • What is the worst case scenario for Roaring bitmaps?

There is no such thing as a data structure that is always ideal. You should make sure that Roaring bitmaps fit your application profile. There are at least two cases where Roaring bitmaps can be easily replaced by superior alternatives compression-wise:

  1. You have few random values spanning in a large interval (i.e., you have a very sparse set). For example, take the set 0, 65536, 131072, 196608, 262144 ... If this is typical of your application, you might consider using a HashSet or a simple sorted array.

  2. You have dense set of random values that never form runs of continuous values. For example, consider the set 0,2,4,...,10000. If this is typical of your application, you might be better served with a conventional bitset (e.g., Java's BitSet class).

  • How do I select an element at random?

       Random random = new Random();
       bitmap.select(random.nextInt(bitmap.getCardinality()));
    

Benchmark

To run JMH benchmarks, use the following command:

     $ ./gradlew jmhJar

You can also run specific benchmarks...

     $ ./jmh/run.sh 'org.roaringbitmap.aggregation.and.identical.*'

Mailing list/discussion group

https://groups.google.com/forum/#!forum/roaring-bitmaps

Funding

This work was supported by NSERC grant number 26143.

Comments
  • Port most of the build to gradle.

    Port most of the build to gradle.

    This is still missing some stuff but I wanted to get feedback on if this was useful / interesting before sinking more time into it.

    Typical gradle subproject structure plus:

    • Multi-release jar for shims subproject
    • Move examples into typical src/main/java and set up tasks for each one, removing the need for a separate shell script
    • Move JMH benchmarks from src/main/java to src/jmh/java since that's how the JMH plugin prefers it. (This allows benchmarks to live in the same module as the normal code, if desired.)

    Missing things:

    • Deploying releases (use Bintray to avoid Sonatype Nexus pain?)
    • jxr
    • perhaps other subtleties I missed/forgot
    opened by marshallpierce 106
  • Introduce RoaringTreeMap to handle a bitmap holding any long value

    Introduce RoaringTreeMap to handle a bitmap holding any long value

    Hello,

    This refers to https://github.com/RoaringBitmap/RoaringBitmap/issues/109

    I needed a bitmap holding any long values to improve management of object references in a fork of MAT. Here is a my current state-of-work: it handles .rank, .select and .getCardinality . I added a few unit-tests.

    If this would actually be integrated in RoaringBitmap, please provide feedbacks about what would be the relevant next-steps, especially regarding naming conventions, or API (e.g. should .getCardinality returns a long).

    new feature 
    opened by blacelle 86
  • Faster deserialization by loading BitmapContainer in a single .readFully

    Faster deserialization by loading BitmapContainer in a single .readFully

    The IO effect of reading bytes one by one seems quite big. With a single .readFully:

    recommended: 247 ms 107 ms 83 ms 177 ms 81 ms 81 ms 107 ms 83 ms 83 ms 116 ms 154 ms 97 ms 82 ms 85 ms 83 ms 84 ms 97 ms 84 ms 84 ms 83 ms 83 ms 117 ms 161 ms 132 ms 82 ms 84 ms 84 ms 84 ms 84 ms 82 ms average: 103 via ByteArrayInputStream: 257 ms 86 ms 86 ms 86 ms 86 ms 84 ms 82 ms 82 ms 180 ms 88 ms 83 ms 85 ms 84 ms 84 ms 85 ms 86 ms 102 ms 90 ms 84 ms 82 ms 83 ms 84 ms 83 ms 85 ms 94 ms 82 ms 81 ms 82 ms 84 ms 82 ms average: 94 via Immutable: 130 ms 69 ms 77 ms 67 ms 67 ms 70 ms 67 ms 64 ms 62 ms 64 ms 77 ms 65 ms 64 ms 63 ms 64 ms 64 ms 64 ms 62 ms 66 ms 64 ms 66 ms 67 ms 64 ms 65 ms 64 ms 62 ms 78 ms 66 ms 65 ms 64 ms average: 68

    Reference: https://github.com/RoaringBitmap/RoaringBitmap/issues/319

    opened by blacelle 46
  • Convert

    Convert "full" bitsets to runs #124

    When ORing two bitsets, the result can be "full" (cardinality = 1<<16). Checking for this occurrence is cheap. When it happens, it should be converted to a "full" run container.

    RunContainer.full helper method to cheaply create "full" run container

    opened by ppiotrow 40
  • Try to go back to publishing directly to Maven Central

    Try to go back to publishing directly to Maven Central

    It appears that the sonatype folks are willing to help us. So if we reconfigure our build for sonatype, they may provide us with a faster access...

    So we need to go through the song and dance and retool our build setup accordingly.

    https://central.sonatype.org/pages/gradle.html

    https://central.sonatype.org/pages/ossrh-guide.html

    cc @richardstartin @marshallpierce

    opened by lemire 36
  • Implement parallel OR and XOR

    Implement parallel OR and XOR

    This PR provides a way to execute arbitrary boolean reductions on bitmaps in parallel.

    Parallel AND and ANDNOT were implemented but found to be unprofitable. They can be implemented as circuits if necessary.

    opened by richardstartin 35
  • Broken releases due(?) to broken maven setup (RoaringBitmapParent artifact)

    Broken releases due(?) to broken maven setup (RoaringBitmapParent artifact)

    I used to issue releases by going to the main RoaringBitmap repository and typing mvn release:clean && mvn release:prepare && mvn release:perform. Since PR https://github.com/RoaringBitmap/RoaringBitmap/pull/181 this no longer works. Sadly, CI does not check that releases are possible, so I did not catch the issue.

    As I recall the point of the release was to move to a "classic maven project" described as follow:

    Cannot we do a classic maven project by moving RoaringBitmap actual source to a specific submodule, and leaving all other submodules where they are?

    Technically, I can issue the commands, but it does not generate an actual release and the result is a broken repository. I left the broken commits on purpose, so you can see the result...

    https://github.com/RoaringBitmap/RoaringBitmap/commits/master

    Note that to be able to do this in a sane way, I had to make a small change to the pom file so that jmh is excluded as a submodule by default, because otherwise, we run the full jmh unit test which takes 3 hours on my machine, and fails for an unclear reason (it looks like -DBITMAP_TYPES=ROARING_ONLY has no effect when doing mvn perform), with The forked VM terminated without saying properly goodbye.

    Anyhow, the broken aspect of the release with mvn release:clean && mvn release:prepare && mvn release:perform has to do with the fact that this attempts to release an artifact RoaringBitmapParent. I am not sure what that is, and I am not sure that it is correct. Yet this seems to have been deliberate, see the pom file: https://github.com/RoaringBitmap/RoaringBitmap/blob/master/pom.xml#L5

    To still be able to issue releases, I did a deploy instead from within the roaringbitmap subdirectory, hoping it would save us from RoaringBitmapParent artifact nonesense...

      cd roaringbitmap
      mvn versions:set -DnewVersion=0.6.53
      mvn clean deploy
      git commit -a
      git tag -a v0.6.53 -m "version 0.6.53"
      git push --tags
      # go to https://oss.sonatype.org/#nexus-search;quick~roaringbitmap and initial the release manually
    

    Sadly, this result in something that is broken as well as you can see from a report on the mailing list:

    I'm having some problems pulling the latest release from maven central via Leiningen:

    [~/repos/streaming-lda] $ lein deps

    Retrieving org/roaringbitmap/RoaringBitmap/0.6.53/RoaringBitmap-0.6.53.pom from central

    Could not find artifact org.roaringbitmap:RoaringBitmapParent:pom:0.6.53 in central > (https://repo1.maven.org/maven2/)

    This could be due to a typo in :dependencies or network issues.

    You can see it's looking for a artifact with "RoaringBitmapParent" in the name. Leiningen doesn't do this when I try to pull down any other version, it just grabs the pom and jar having the usual names, like this: [~/repos/streaming-lda] $ lein deps Retrieving org/roaringbitmap/RoaringBitmap/0.6.49/RoaringBitmap-0.6.49.pom from central Retrieving org/roaringbitmap/RoaringBitmap/0.6.49/RoaringBitmap-0.6.49.jar from central
    I can see from the history your pom file that this is some sort of intentional change. My maven knowledge is fairly low, but I'm suspicious that this is something Leiningen either doesn't support requires some workaround for. Do you know anything more about this than I do?

    Anyhow, it seems clear that either the maven project is broken or else, I am lacking the right release instructions.

    I think that this is an urgent problem.

    bug help wanted URGENT 
    opened by lemire 33
  • Enable Portable format in Roaring64NavigableMap

    Enable Portable format in Roaring64NavigableMap

    SUMMARY

    • Implement the portable format as coded in CRoaring (https://github.com/RoaringBitmap/CRoaring/blob/master/cpp/roaring64map.hh#L991) (and Go ? (https://github.com/RoaringBitmap/roaring/tree/master/roaring64))
    • Unit-tests has been introduced, based on binary files existing in CRoaring repository

    Automated Checks

    • [ ] I have run ./gradlew test and made sure that my PR does not break any unit test.
    • [ ] I have run ./gradlew checkstyleMain or the equivalent and corrected the formatting warnings reported.
    opened by blacelle 30
  • AC.andNot(RC)

    AC.andNot(RC)

    I've decided to try using Util.advanceUntil in andNot between ArrayContainer and RunContainer. The implementation present in the commit was verified with present tests and a new one, but for sure I'd test it more if going to be merged.

    I run two benchmarks part{3,4}_andNotArrayContainerVSRunContainerContainer on master and the new branch.

    BasicAndNotContainerBenchmark.part3_andNotArrayContainerVSRunContainerContainer  avgt   15  3327,444 ± 49,353  ns/op
    BasicAndNotContainerBenchmark.part4_andNotArrayContainerVSRunContainerContainer  avgt   15  1877,370 ± 25,888  ns/op
    
    BasicAndNotContainerBenchmark.part3_andNotArrayContainerVSRunContainerContainer  avgt   15  7790,214 ± 81,502  ns/op
    BasicAndNotContainerBenchmark.part4_andNotArrayContainerVSRunContainerContainer  avgt   15  638,899 ± 4,385  ns/op
    

    The code is slower for the present benchmark which andNot Array Container of 1024 elements with very dense Run Container of 1009 runs with 64512 cardinality. The new benchmark uses Run Container with 5 very long runs and the new code is 3x faster.

    I'm opening this Pull Request to discuss

    • is it worth to use new approach?
    • should there be a switch when to use old and new approach?

    I think the new approach will be faster when there are long sequences of array elements covered by runs or between two runs. If there are very few array elements per run or between runs the old approach should be faster.

    opened by ppiotrow 30
  • Much faster deserialization via new ImmutableRoaringBitmap(ByteBuffer.wrap(data)).toRoaringBitmap()

    Much faster deserialization via new ImmutableRoaringBitmap(ByteBuffer.wrap(data)).toRoaringBitmap()

    The two seemingly equivalent operations below yield deserialization performance results. "Example 1" below seems to perform 5x to 10x faster than the typical bitmap deserialization as shown in "Example 2".

    //Example 1
    //byte[] -> ImmutableRoaringBitmap -> RoaringBitmap
    byte[] = data
    RoaringBitmap bitmap = new ImmutableRoaringBitmap(ByteBuffer.wrap(data)).toRoaringBitmap();
    

    vs

    //Example 2
    //byte[] -> RoaringBitmap
    byte[] = data
    RoaringBitmap bitmap = new RoaringBitmap();
    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    
    try (DataInputStream dis = new DataInputStream(bais)) {
                bitmap.deserialize(dis);
     }
    ...
    
    benchmarking performance help wanted 
    opened by PedroAlvarado 28
  • Cannot release, maven process broken

    Cannot release, maven process broken

    $ mvn release:clean release:prepare release:perform
    (skipping one million lines)
    [INFO] [binaryTest] 70
    [INFO] [binaryTest] 71
    [INFO] [binaryTest] 72
    [INFO] [binaryTest] 73
    [INFO] [binaryTest] 74
    [INFO] [binaryTest] 75
    [INFO] [binaryTest] 76
    [INFO] [binaryTest] 77
    [INFO] [binaryTest] 78
    [INFO] [binaryTest] 79
    [INFO] [binaryTest] 80
    [INFO] [binaryTest] 81
    [INFO] [binaryTest] 82
    [INFO] [binaryTest] 83
    [INFO] [binaryTest] 84
    [INFO] [binaryTest] 85
    [INFO] [binaryTest] 86
    [INFO] [binaryTest] 87
    [INFO] [binaryTest] 88
    [INFO] [binaryTest] 89
    [INFO] [binaryTest] 90
    [INFO] [binaryTest] 91
    [INFO] [binaryTest] 92
    [INFO] [binaryTest] 93
    [INFO] [binaryTest] 94
    [INFO] [binaryTest] 95
    [INFO] [binaryTest] 96
    [INFO] [binaryTest] 97
    [INFO] [binaryTest] 98
    [INFO] [binaryTest] 99
    [INFO] [binaryTest] 100
    [INFO] [binaryTest] 101
    [INFO] [binaryTest] 102
    [INFO] [binaryTest] 103
    [INFO] [binaryTest] 104
    [INFO] [binaryTest] 105
    [INFO] [binaryTest] 106
    [INFO] [binaryTest] 107
    [INFO] [binaryTest] 108
    [INFO] [binaryTest] 109
    [INFO] [binaryTest] 110
    [INFO] [binaryTest] 111
    [INFO] [binaryTest] 112
    [INFO] [binaryTest] 113
    [INFO] [binaryTest] 114
    [INFO] [binaryTest] 115
    [INFO] [binaryTest] 116
    [INFO] [binaryTest] 117
    [INFO] [binaryTest] 118
    [INFO] [binaryTest] 119
    [INFO] [binaryTest] 120
    [INFO] [binaryTest] 121
    [INFO] [binaryTest] 122
    [INFO] [binaryTest] 123
    [INFO] [binaryTest] 124
    [INFO] [binaryTest] 125
    [INFO] [binaryTest] 126
    [INFO] [binaryTest] 127
    [INFO] [binaryTest] 128
    [INFO] [binaryTest] 129
    [INFO] [binaryTest] 130
    [INFO] [binaryTest] 131
    [INFO] [binaryTest] 132
    [INFO] [binaryTest] 133
    [INFO] [binaryTest] 134
    [INFO] [binaryTest] 135
    [INFO] [binaryTest] 136
    [INFO] [binaryTest] 137
    [INFO] [binaryTest] 138
    [INFO] [binaryTest] 139
    [INFO] [binaryTest] 140
    [INFO] [binaryTest] 141
    [INFO] [binaryTest] 142
    [INFO] [binaryTest] 143
    [INFO] [binaryTest] 144
    [INFO] [binaryTest] 145
    [INFO] [binaryTest] 146
    [INFO] [binaryTest] 147
    [INFO] [binaryTest] 148
    [INFO] [binaryTest] 149
    [INFO] [binaryTest] 150
    [INFO] [binaryTest] 151
    [INFO] [binaryTest] 152
    [INFO] [binaryTest] 153
    [INFO] [binaryTest] 154
    [INFO] [binaryTest] 155
    [INFO] [binaryTest] 156
    [INFO] [binaryTest] 157
    [INFO] [binaryTest] 158
    [INFO] [binaryTest] 159
    [INFO] [binaryTest] 160
    [INFO] [binaryTest] 161
    [INFO] [binaryTest] 162
    [INFO] [binaryTest] 163
    [INFO] [binaryTest] 164
    [INFO] [binaryTest] 165
    [INFO] [binaryTest] 166
    [INFO] [binaryTest] 167
    [INFO] [binaryTest] 168
    [INFO] [binaryTest] 169
    [INFO] [binaryTest] 170
    [INFO] [binaryTest] 171
    [INFO] [binaryTest] 172
    [INFO] [binaryTest] 173
    [INFO] [binaryTest] 174
    [INFO] [binaryTest] 175
    [INFO] [binaryTest] 176
    [INFO] [binaryTest] 177
    [INFO] [binaryTest] 178
    [INFO] [binaryTest] 179
    [INFO] [binaryTest] 180
    [INFO] [binaryTest] 181
    [INFO] [binaryTest] 182
    [INFO] [binaryTest] 183
    [INFO] [binaryTest] 184
    [INFO] [binaryTest] 185
    [INFO] [binaryTest] 186
    [INFO] [binaryTest] 187
    [INFO] [binaryTest] 188
    [INFO] [binaryTest] 189
    [INFO] [binaryTest] 190
    [INFO] [binaryTest] 191
    [INFO] [binaryTest] 192
    [INFO] [binaryTest] 193
    [INFO] [binaryTest] 194
    [INFO] [binaryTest] 195
    [INFO] [binaryTest] 196
    [INFO] [binaryTest] 197
    [INFO] [binaryTest] 198
    [INFO] [binaryTest] 199
    [INFO] [binaryTest] 200
    [INFO] [binaryTest] 201
    [INFO] [binaryTest] 202
    [INFO] [binaryTest] 203
    [INFO] [binaryTest] 204
    [INFO] [binaryTest] 205
    [INFO] [binaryTest] 206
    [INFO] [binaryTest] 207
    [INFO] [binaryTest] 208
    [INFO] [binaryTest] 209
    [INFO] [binaryTest] 210
    [INFO] [binaryTest] 211
    [INFO] [binaryTest] 212
    [INFO] [binaryTest] 213
    [INFO] [binaryTest] 214
    [INFO] [binaryTest] 215
    [INFO] [binaryTest] 216
    [INFO] [binaryTest] 217
    [INFO] [binaryTest] 218
    [INFO] [binaryTest] 219
    [INFO] [binaryTest] 220
    [INFO] [binaryTest] 221
    [INFO] [binaryTest] 222
    [INFO] [binaryTest] 223
    [INFO] [binaryTest] 224
    [INFO] [binaryTest] 225
    [INFO] [binaryTest] 226
    [INFO] [binaryTest] 227
    [INFO] [binaryTest] 228
    [INFO] [binaryTest] 229
    [INFO] [binaryTest] 230
    [INFO] [binaryTest] 231
    [INFO] [binaryTest] 232
    [INFO] [binaryTest] 233
    [INFO] [binaryTest] 234
    [INFO] [binaryTest] 235
    [INFO] [binaryTest] 236
    [INFO] [binaryTest] 237
    [INFO] [binaryTest] 238
    [INFO] [binaryTest] 239
    [INFO] [binaryTest] 240
    [INFO] [binaryTest] 241
    [INFO] [binaryTest] 242
    [INFO] [binaryTest] 243
    [INFO] [binaryTest] 244
    [INFO] [binaryTest] 245
    [INFO] [binaryTest] 246
    [INFO] [binaryTest] 247
    [INFO] [binaryTest] 248
    [INFO] [binaryTest] 249
    [INFO] [binaryTest] 250
    [INFO] [binaryTest] 251
    [INFO] [binaryTest] 252
    [INFO] [binaryTest] 253
    [INFO] [binaryTest] 254
    [INFO] [binaryTest] 255
    [INFO] [binaryTest] 256
    [INFO] [binaryTest] 257
    [INFO] [binaryTest] 258
    [INFO] [binaryTest] 259
    [INFO] [binaryTest] 260
    [INFO] [binaryTest] 261
    [INFO] [binaryTest] 262
    [INFO] [binaryTest] 263
    [INFO] [binaryTest] 264
    [INFO] [binaryTest] 265
    [INFO] [binaryTest] 266
    [INFO] [binaryTest] 267
    [INFO] [binaryTest] 268
    [INFO] [binaryTest] 269
    [INFO] [binaryTest] 270
    [INFO] [binaryTest] 271
    [INFO] [binaryTest] 272
    [INFO] [binaryTest] 273
    [INFO] [binaryTest] 274
    [INFO] [binaryTest] 275
    [INFO] [binaryTest] 276
    [INFO] [binaryTest] 277
    [INFO] [binaryTest] 278
    [INFO] [binaryTest] 279
    [INFO] [binaryTest] 280
    [INFO] [binaryTest] 281
    [INFO] [binaryTest] 282
    [INFO] [binaryTest] 283
    [INFO] [binaryTest] 284
    [INFO] [binaryTest] 285
    [INFO] [binaryTest] 286
    [INFO] [binaryTest] 287
    [INFO] [binaryTest] 288
    [INFO] [binaryTest] 289
    [INFO] [binaryTest] 290
    [INFO] [binaryTest] 291
    [INFO] [binaryTest] 292
    [INFO] [binaryTest] 293
    [INFO] [binaryTest] 294
    [INFO] [binaryTest] 295
    [INFO] [binaryTest] 296
    [INFO] [binaryTest] 297
    [INFO] [binaryTest] 298
    [INFO] [binaryTest] 299
    [INFO] [binaryTest] 300
    [INFO] [binaryTest] 301
    [INFO] [binaryTest] 302
    [INFO] [binaryTest] 303
    [INFO] [binaryTest] 304
    [INFO] [binaryTest] 305
    [INFO] [binaryTest] 306
    [INFO] [binaryTest] 307
    [INFO] [binaryTest] 308
    [INFO] [binaryTest] 309
    [INFO] [binaryTest] 310
    [INFO] [binaryTest] 311
    [INFO] [binaryTest] 312
    [INFO] [binaryTest] 313
    [INFO] [binaryTest] 314
    [INFO] [binaryTest] 315
    [INFO] [binaryTest] 316
    [INFO] [binaryTest] 317
    [INFO] [binaryTest] 318
    [INFO] [binaryTest] 319
    [INFO] [binaryTest] 320
    [INFO] [binaryTest] 321
    [INFO] [binaryTest] 322
    [INFO] [binaryTest] 323
    [INFO] [binaryTest] 324
    [INFO] [binaryTest] 325
    [INFO] [binaryTest] 326
    [INFO] [binaryTest] 327
    [INFO] [binaryTest] 328
    [INFO] [binaryTest] 329
    [INFO] [binaryTest] 330
    [INFO] [binaryTest] 331
    [INFO] [binaryTest] 332
    [INFO] [binaryTest] 333
    [INFO] [binaryTest] 334
    [INFO] [binaryTest] 335
    [INFO] [binaryTest] 336
    [INFO] [binaryTest] 337
    [INFO] [binaryTest] 338
    [INFO] [binaryTest] 339
    [INFO] [binaryTest] 340
    [INFO] [binaryTest] 341
    [INFO] [binaryTest] 342
    [INFO] [binaryTest] 343
    [INFO] [binaryTest] 344
    [INFO] [binaryTest] 345
    [INFO] [binaryTest] 346
    [INFO] [binaryTest] 347
    [INFO] [binaryTest] 348
    [INFO] [binaryTest] 349
    [INFO] [binaryTest] 350
    [INFO] [binaryTest] 351
    [INFO] [binaryTest] 352
    [INFO] [binaryTest] 353
    [INFO] [binaryTest] 354
    [INFO] [binaryTest] 355
    [INFO] [binaryTest] 356
    [INFO] [binaryTest] 357
    [INFO] [binaryTest] 358
    [INFO] [binaryTest] 359
    [INFO] [binaryTest] 360
    [INFO] [binaryTest] 361
    [INFO] [binaryTest] 362
    [INFO] [binaryTest] 363
    [INFO] [binaryTest] 364
    [INFO] [binaryTest] 365
    [INFO] [binaryTest] 366
    [INFO] [binaryTest] 367
    [INFO] [binaryTest] 368
    [INFO] [binaryTest] 369
    [INFO] [binaryTest] 370
    [INFO] [binaryTest] 371
    [INFO] [binaryTest] 372
    [INFO] [binaryTest] 373
    [INFO] [binaryTest] 374
    [INFO] [binaryTest] 375
    [INFO] [binaryTest] 376
    [INFO] [binaryTest] 377
    [INFO] [binaryTest] 378
    [INFO] [binaryTest] 379
    [INFO] [binaryTest] 380
    [INFO] [binaryTest] 381
    [INFO] [binaryTest] 382
    [INFO] [binaryTest] 383
    [INFO] [binaryTest] 384
    [INFO] [binaryTest] 385
    [INFO] [binaryTest] 386
    [INFO] [binaryTest] 387
    [INFO] [binaryTest] 388
    [INFO] [binaryTest] 389
    [INFO] [binaryTest] 390
    [INFO] [binaryTest] 391
    [INFO] [binaryTest] 392
    [INFO] [binaryTest] 393
    [INFO] [binaryTest] 394
    [INFO] [binaryTest] 395
    [INFO] [binaryTest] 396
    [INFO] [binaryTest] 397
    [INFO] [binaryTest] 398
    [INFO] [binaryTest] 399
    [INFO] [binaryTest] 400
    [INFO] [binaryTest] 401
    [INFO] [binaryTest] 402
    [INFO] [binaryTest] 403
    [INFO] [binaryTest] 404
    [INFO] [binaryTest] 405
    [INFO] [binaryTest] 406
    [INFO] [binaryTest] 407
    [INFO] [binaryTest] 408
    [INFO] [binaryTest] 409
    [INFO] [binaryTest] 410
    [INFO] [binaryTest] 411
    [INFO] [binaryTest] 412
    [INFO] [binaryTest] 413
    [INFO] [binaryTest] 414
    [INFO] [binaryTest] 415
    [INFO] [binaryTest] 416
    [INFO] [binaryTest] 417
    [INFO] [binaryTest] 418
    [INFO] [binaryTest] 419
    [INFO] [binaryTest] 420
    [INFO] [binaryTest] 421
    [INFO] [binaryTest] 422
    [INFO] [binaryTest] 423
    [INFO] [binaryTest] 424
    [INFO] [binaryTest] 425
    [INFO] [binaryTest] 426
    [INFO] [binaryTest] 427
    [INFO] [binaryTest] 428
    [INFO] [binaryTest] 429
    [INFO] [binaryTest] 430
    [INFO] [binaryTest] 431
    [INFO] [binaryTest] 432
    [INFO] [binaryTest] 433
    [INFO] [binaryTest] 434
    [INFO] [binaryTest] 435
    [INFO] [binaryTest] 436
    [INFO] [binaryTest] 437
    [INFO] [binaryTest] 438
    [INFO] [binaryTest] 439
    [INFO] [binaryTest] 440
    [INFO] [binaryTest] 441
    [INFO] [binaryTest] 442
    [INFO] [binaryTest] 443
    [INFO] [binaryTest] 444
    [INFO] [binaryTest] 445
    [INFO] [binaryTest] 446
    [INFO] [binaryTest] 447
    [INFO] [binaryTest] 448
    [INFO] [binaryTest] 449
    [INFO] [binaryTest] 450
    [INFO] [binaryTest] 451
    [INFO] [binaryTest] 452
    [INFO] [binaryTest] 453
    [INFO] [binaryTest] 454
    [INFO] [binaryTest] 455
    [INFO] [binaryTest] 456
    [INFO] [binaryTest] 457
    [INFO] [binaryTest] 458
    [INFO] [binaryTest] 459
    [INFO] [binaryTest] 460
    [INFO] [binaryTest] 461
    [INFO] [binaryTest] 462
    [INFO] [binaryTest] 463
    [INFO] [binaryTest] 464
    [INFO] [binaryTest] 465
    [INFO] [binaryTest] 466
    [INFO] [binaryTest] 467
    [INFO] [binaryTest] 468
    [INFO] [binaryTest] 469
    [INFO] [binaryTest] 470
    [INFO] [binaryTest] 471
    [INFO] [binaryTest] 472
    [INFO] [binaryTest] 473
    [INFO] [binaryTest] 474
    [INFO] [binaryTest] 475
    [INFO] [binaryTest] 476
    [INFO] [binaryTest] 477
    [INFO] [binaryTest] 478
    [INFO] [binaryTest] 479
    [INFO] [binaryTest] 480
    [INFO] [binaryTest] 481
    [INFO] [binaryTest] 482
    [INFO] [binaryTest] 483
    [INFO] [binaryTest] 484
    [INFO] [binaryTest] 485
    [INFO] [binaryTest] 486
    [INFO] [binaryTest] 487
    [INFO] [binaryTest] 488
    [INFO] [binaryTest] 489
    [INFO] [binaryTest] 490
    [INFO] [binaryTest] 491
    [INFO] [binaryTest] 492
    [INFO] [binaryTest] 493
    [INFO] [binaryTest] 494
    [INFO] [binaryTest] 495
    [INFO] [binaryTest] 496
    [INFO] [binaryTest] 497
    [INFO] [binaryTest] 498
    [INFO] [binaryTest] 499
    [INFO] [binaryTest] 500
    [INFO] [binaryTest] 501
    [INFO] [binaryTest] 502
    [INFO] [binaryTest] 503
    [INFO] [binaryTest] 504
    [INFO] [binaryTest] 505
    [INFO] [binaryTest] 506
    [INFO] [binaryTest] 507
    [INFO] [binaryTest] 508
    [INFO] [binaryTest] 509
    [INFO] [binaryTest] 510
    [INFO] [binaryTest] 511
    [INFO] [binaryTest] 512
    [INFO] [binaryTest] 513
    [INFO] [binaryTest] 514
    [INFO] [binaryTest] 515
    [INFO] [binaryTest] 516
    [INFO] [binaryTest] 517
    [INFO] [binaryTest] 518
    [INFO] [binaryTest] 519
    [INFO] [binaryTest] 520
    [INFO] [binaryTest] 521
    [INFO] [binaryTest] 522
    [INFO] [binaryTest] 523
    [INFO] [binaryTest] 524
    [INFO] [binaryTest] 525
    [INFO] [binaryTest] 526
    [INFO] [binaryTest] 527
    [INFO] [binaryTest] 528
    [INFO] [binaryTest] 529
    [INFO] [binaryTest] 530
    [INFO] [binaryTest] 531
    [INFO] [binaryTest] 532
    [INFO] [binaryTest] 533
    [INFO] [binaryTest] 534
    [INFO] [binaryTest] 535
    [INFO] [binaryTest] 536
    [INFO] [binaryTest] 537
    [INFO] [binaryTest] 538
    [INFO] [binaryTest] 539
    [INFO] [binaryTest] 540
    [INFO] [binaryTest] 541
    [INFO] [binaryTest] 542
    [INFO] [binaryTest] 543
    [INFO] [binaryTest] 544
    [INFO] [binaryTest] 545
    [INFO] [binaryTest] 546
    [INFO] [binaryTest] 547
    [INFO] [binaryTest] 548
    [INFO] [binaryTest] 549
    [INFO] [binaryTest] 550
    [INFO] [binaryTest] 551
    [INFO] [binaryTest] 552
    [INFO] [binaryTest] 553
    [INFO] [binaryTest] 554
    [INFO] [binaryTest] 555
    [INFO] [binaryTest] 556
    [INFO] [binaryTest] 557
    [INFO] [binaryTest] 558
    [INFO] [binaryTest] 559
    [INFO] [binaryTest] 560
    [INFO] [binaryTest] 561
    [INFO] [binaryTest] 562
    [INFO] [binaryTest] 563
    [INFO] [binaryTest] 564
    [INFO] [binaryTest] 565
    [INFO] [binaryTest] 566
    [INFO] [binaryTest] 567
    [INFO] [binaryTest] 568
    [INFO] [binaryTest] 569
    [INFO] [binaryTest] 570
    [INFO] [binaryTest] 571
    [INFO] [binaryTest] 572
    [INFO] [binaryTest] 573
    [INFO] [binaryTest] 574
    [INFO] [binaryTest] 575
    [INFO] [binaryTest] 576
    [INFO] [binaryTest] 577
    [INFO] [binaryTest] 578
    [INFO] [binaryTest] 579
    [INFO] [binaryTest] 580
    [INFO] [binaryTest] 581
    [INFO] [binaryTest] 582
    [INFO] [binaryTest] 583
    [INFO] [binaryTest] 584
    [INFO] [binaryTest] 585
    [INFO] [binaryTest] 586
    [INFO] [binaryTest] 587
    [INFO] [binaryTest] 588
    [INFO] [binaryTest] 589
    [INFO] [binaryTest] 590
    [INFO] [binaryTest] 591
    [INFO] [binaryTest] 592
    [INFO] [binaryTest] 593
    [INFO] [binaryTest] 594
    [INFO] [binaryTest] 595
    [INFO] [binaryTest] 596
    [INFO] [binaryTest] 597
    [INFO] [binaryTest] 598
    [INFO] [binaryTest] 599
    [INFO] [binaryTest] 600
    [INFO] [binaryTest] 601
    [INFO] [binaryTest] 602
    [INFO] [binaryTest] 603
    [INFO] [binaryTest] 604
    [INFO] [binaryTest] 605
    [INFO] [binaryTest] 606
    [INFO] [binaryTest] 607
    [INFO] [binaryTest] 608
    [INFO] [binaryTest] 609
    [INFO] [binaryTest] 610
    [INFO] [binaryTest] 611
    [INFO] [binaryTest] 612
    [INFO] [binaryTest] 613
    [INFO] [binaryTest] 614
    [INFO] [binaryTest] 615
    [INFO] [binaryTest] 616
    [INFO] [binaryTest] 617
    [INFO] [binaryTest] 618
    [INFO] [binaryTest] 619
    [INFO] [binaryTest] 620
    [INFO] [binaryTest] 621
    [INFO] [binaryTest] 622
    [INFO] [binaryTest] 623
    [INFO] [binaryTest] 624
    [INFO] [binaryTest] 625
    [INFO] [binaryTest] 626
    [INFO] [binaryTest] 627
    [INFO] [binaryTest] 628
    [INFO] [binaryTest] 629
    [INFO] [binaryTest] 630
    [INFO] [binaryTest] 631
    [INFO] [binaryTest] 632
    [INFO] [binaryTest] 633
    [INFO] [binaryTest] 634
    [INFO] [binaryTest] 635
    [INFO] [binaryTest] 636
    [INFO] [binaryTest] 637
    [INFO] [binaryTest] 638
    [INFO] [binaryTest] 639
    [INFO] [binaryTest] 640
    [INFO] [binaryTest] 641
    [INFO] [binaryTest] 642
    [INFO] [binaryTest] 643
    [INFO] [binaryTest] 644
    [INFO] [binaryTest] 645
    [INFO] [binaryTest] 646
    [INFO] [binaryTest] 647
    [INFO] [binaryTest] 648
    [INFO] [binaryTest] 649
    [INFO] [binaryTest] 650
    [INFO] [binaryTest] 651
    [INFO] [binaryTest] 652
    [INFO] [binaryTest] 653
    [INFO] [binaryTest] 654
    [INFO] [binaryTest] 655
    [INFO] [binaryTest] 656
    [INFO] [binaryTest] 657
    [INFO] [binaryTest] 658
    [INFO] [binaryTest] 659
    [INFO] [binaryTest] 660
    [INFO] [binaryTest] 661
    [INFO] [binaryTest] 662
    [INFO] [binaryTest] 663
    [INFO] [binaryTest] 664
    [INFO] [binaryTest] 665
    [INFO] [binaryTest] 666
    [INFO] [binaryTest] 667
    [INFO] [binaryTest] 668
    [INFO] [binaryTest] 669
    [INFO] [binaryTest] 670
    [INFO] [binaryTest] 671
    [INFO] [binaryTest] 672
    [INFO] [binaryTest] 673
    [INFO] [binaryTest] 674
    [INFO] [binaryTest] 675
    [INFO] [binaryTest] 676
    [INFO] [binaryTest] 677
    [INFO] [binaryTest] 678
    [INFO] [binaryTest] 679
    [INFO] [binaryTest] 680
    [INFO] [binaryTest] 681
    [INFO] [binaryTest] 682
    [INFO] [binaryTest] 683
    [INFO] [binaryTest] 684
    [INFO] [binaryTest] 685
    [INFO] [binaryTest] 686
    [INFO] [binaryTest] 687
    [INFO] [binaryTest] 688
    [INFO] [binaryTest] 689
    [INFO] [binaryTest] 690
    [INFO] [binaryTest] 691
    [INFO] [binaryTest] 692
    [INFO] [binaryTest] 693
    [INFO] [binaryTest] 694
    [INFO] [binaryTest] 695
    [INFO] [binaryTest] 696
    [INFO] [binaryTest] 697
    [INFO] [binaryTest] 698
    [INFO] [binaryTest] 699
    [INFO] [binaryTest] 700
    [INFO] [binaryTest] 701
    [INFO] [binaryTest] 702
    [INFO] [binaryTest] 703
    [INFO] [binaryTest] 704
    [INFO] [binaryTest] 705
    [INFO] [binaryTest] 706
    [INFO] [binaryTest] 707
    [INFO] [binaryTest] 708
    [INFO] [binaryTest] 709
    [INFO] [binaryTest] 710
    [INFO] [binaryTest] 711
    [INFO] [binaryTest] 712
    [INFO] [binaryTest] 713
    [INFO] [binaryTest] 714
    [INFO] [binaryTest] 715
    [INFO] [binaryTest] 716
    [INFO] [binaryTest] 717
    [INFO] [binaryTest] 718
    [INFO] [binaryTest] 719
    [INFO] [binaryTest] 720
    [INFO] [binaryTest] 721
    [INFO] [binaryTest] 722
    [INFO] [binaryTest] 723
    [INFO] [binaryTest] 724
    [INFO] [binaryTest] 725
    [INFO] [binaryTest] 726
    [INFO] [binaryTest] 727
    [INFO] [binaryTest] 728
    [INFO] [binaryTest] 729
    [INFO] [binaryTest] 730
    [INFO] [binaryTest] 731
    [INFO] [binaryTest] 732
    [INFO] [binaryTest] 733
    [INFO] [binaryTest] 734
    [INFO] [binaryTest] 735
    [INFO] [binaryTest] 736
    [INFO] [binaryTest] 737
    [INFO] [binaryTest] 738
    [INFO] [binaryTest] 739
    [INFO] [binaryTest] 740
    [INFO] [binaryTest] 741
    [INFO] [binaryTest] 742
    [INFO] [binaryTest] 743
    [INFO] [binaryTest] 744
    [INFO] [binaryTest] 745
    [INFO] [binaryTest] 746
    [INFO] [binaryTest] 747
    [INFO] [binaryTest] 748
    [INFO] [binaryTest] 749
    [INFO] [binaryTest] 750
    [INFO] [binaryTest] 751
    [INFO] [binaryTest] 752
    [INFO] [binaryTest] 753
    [INFO] [binaryTest] 754
    [INFO] [binaryTest] 755
    [INFO] [binaryTest] 756
    [INFO] [binaryTest] 757
    [INFO] [binaryTest] 758
    [INFO] [binaryTest] 759
    [INFO] [binaryTest] 760
    [INFO] [binaryTest] 761
    [INFO] [binaryTest] 762
    [INFO] [binaryTest] 763
    [INFO] [binaryTest] 764
    [INFO] [binaryTest] 765
    [INFO] [binaryTest] 766
    [INFO] [binaryTest] 767
    [INFO] [binaryTest] 768
    [INFO] [binaryTest] 769
    [INFO] [binaryTest] 770
    [INFO] [binaryTest] 771
    [INFO] [binaryTest] 772
    [INFO] [binaryTest] 773
    [INFO] [binaryTest] 774
    [INFO] [binaryTest] 775
    [INFO] [binaryTest] 776
    [INFO] [binaryTest] 777
    [INFO] [binaryTest] 778
    [INFO] [binaryTest] 779
    [INFO] [binaryTest] 780
    [INFO] [binaryTest] 781
    [INFO] [binaryTest] 782
    [INFO] [binaryTest] 783
    [INFO] [binaryTest] 784
    [INFO] [binaryTest] 785
    [INFO] [binaryTest] 786
    [INFO] [binaryTest] 787
    [INFO] [binaryTest] 788
    [INFO] [binaryTest] 789
    [INFO] [binaryTest] 790
    [INFO] [binaryTest] 791
    [INFO] [binaryTest] 792
    [INFO] [binaryTest] 793
    [INFO] [binaryTest] 794
    [INFO] [binaryTest] 795
    [INFO] [binaryTest] 796
    [INFO] [binaryTest] 797
    [INFO] [binaryTest] 798
    [INFO] [binaryTest] 799
    [INFO] [binaryTest] 800
    [INFO] [binaryTest] 801
    [INFO] [binaryTest] 802
    [INFO] [binaryTest] 803
    [INFO] [binaryTest] 804
    [INFO] [binaryTest] 805
    [INFO] [binaryTest] 806
    [INFO] [binaryTest] 807
    [INFO] [binaryTest] 808
    [INFO] [binaryTest] 809
    [INFO] [binaryTest] 810
    [INFO] [binaryTest] 811
    [INFO] [binaryTest] 812
    [INFO] [binaryTest] 813
    [INFO] [binaryTest] 814
    [INFO] [binaryTest] 815
    [INFO] [binaryTest] 816
    [INFO] [binaryTest] 817
    [INFO] [binaryTest] 818
    [INFO] [binaryTest] 819
    [INFO] [binaryTest] 820
    [INFO] [binaryTest] 821
    [INFO] [binaryTest] 822
    [INFO] [binaryTest] 823
    [INFO] [binaryTest] 824
    [INFO] [binaryTest] 825
    [INFO] [binaryTest] 826
    [INFO] [binaryTest] 827
    [INFO] [binaryTest] 828
    [INFO] [binaryTest] 829
    [INFO] [binaryTest] 830
    [INFO] [binaryTest] 831
    [INFO] [binaryTest] 832
    [INFO] [binaryTest] 833
    [INFO] [binaryTest] 834
    [INFO] [binaryTest] 835
    [INFO] [binaryTest] 836
    [INFO] [binaryTest] 837
    [INFO] [binaryTest] 838
    [INFO] [binaryTest] 839
    [INFO] [binaryTest] 840
    [INFO] [binaryTest] 841
    [INFO] [binaryTest] 842
    [INFO] [binaryTest] 843
    [INFO] [binaryTest] 844
    [INFO] [binaryTest] 845
    [INFO] [binaryTest] 846
    [INFO] [binaryTest] 847
    [INFO] [binaryTest] 848
    [INFO] [binaryTest] 849
    [INFO] [binaryTest] 850
    [INFO] [binaryTest] 851
    [INFO] [binaryTest] 852
    [INFO] [binaryTest] 853
    [INFO] [binaryTest] 854
    [INFO] [binaryTest] 855
    [INFO] [binaryTest] 856
    [INFO] [binaryTest] 857
    [INFO] [binaryTest] 858
    [INFO] [binaryTest] 859
    [INFO] [binaryTest] 860
    [INFO] [binaryTest] 861
    [INFO] [binaryTest] 862
    [INFO] [binaryTest] 863
    [INFO] [binaryTest] 864
    [INFO] [binaryTest] 865
    [INFO] [binaryTest] 866
    [INFO] [binaryTest] 867
    [INFO] [binaryTest] 868
    [INFO] [binaryTest] 869
    [INFO] [binaryTest] 870
    [INFO] [binaryTest] 871
    [INFO] [binaryTest] 872
    [INFO] [binaryTest] 873
    [INFO] [binaryTest] 874
    [INFO] [binaryTest] 875
    [INFO] [binaryTest] 876
    [INFO] [binaryTest] 877
    [INFO] [binaryTest] 878
    [INFO] [binaryTest] 879
    [INFO] [binaryTest] 880
    [INFO] [binaryTest] 881
    [INFO] [binaryTest] 882
    [INFO] [binaryTest] 883
    [INFO] [binaryTest] 884
    [INFO] [binaryTest] 885
    [INFO] [binaryTest] 886
    [INFO] [binaryTest] 887
    [INFO] [binaryTest] 888
    [INFO] [binaryTest] 889
    [INFO] [binaryTest] 890
    [INFO] [binaryTest] 891
    [INFO] [binaryTest] 892
    [INFO] [binaryTest] 893
    [INFO] [binaryTest] 894
    [INFO] [binaryTest] 895
    [INFO] [binaryTest] 896
    [INFO] [binaryTest] 897
    [INFO] [binaryTest] 898
    [INFO] [binaryTest] 899
    [INFO] [binaryTest] 900
    [INFO] [binaryTest] 901
    [INFO] [binaryTest] 902
    [INFO] [binaryTest] 903
    [INFO] [binaryTest] 904
    [INFO] [binaryTest] 905
    [INFO] [binaryTest] 906
    [INFO] [binaryTest] 907
    [INFO] [binaryTest] 908
    [INFO] [binaryTest] 909
    [INFO] [binaryTest] 910
    [INFO] [binaryTest] 911
    [INFO] [binaryTest] 912
    [INFO] [binaryTest] 913
    [INFO] [binaryTest] 914
    [INFO] [binaryTest] 915
    [INFO] [binaryTest] 916
    [INFO] [binaryTest] 917
    [INFO] [binaryTest] 918
    [INFO] [binaryTest] 919
    [INFO] [binaryTest] 920
    [INFO] [binaryTest] 921
    [INFO] [binaryTest] 922
    [INFO] [binaryTest] 923
    [INFO] [binaryTest] 924
    [INFO] [binaryTest] 925
    [INFO] [binaryTest] 926
    [INFO] [binaryTest] 927
    [INFO] [binaryTest] 928
    [INFO] [binaryTest] 929
    [INFO] [binaryTest] 930
    [INFO] [binaryTest] 931
    [INFO] [binaryTest] 932
    [INFO] [binaryTest] 933
    [INFO] [binaryTest] 934
    [INFO] [binaryTest] 935
    [INFO] [binaryTest] 936
    [INFO] [binaryTest] 937
    [INFO] [binaryTest] 938
    [INFO] [binaryTest] 939
    [INFO] [binaryTest] 940
    [INFO] [binaryTest] 941
    [INFO] [binaryTest] 942
    [INFO] [binaryTest] 943
    [INFO] [binaryTest] 944
    [INFO] [binaryTest] 945
    [INFO] [binaryTest] 946
    [INFO] [binaryTest] 947
    [INFO] [binaryTest] 948
    [INFO] [binaryTest] 949
    [INFO] [binaryTest] 950
    [INFO] [binaryTest] 951
    [INFO] [binaryTest] 952
    [INFO] [binaryTest] 953
    [INFO] [binaryTest] 954
    [INFO] [binaryTest] 955
    [INFO] [binaryTest] 956
    [INFO] [binaryTest] 957
    [INFO] [binaryTest] 958
    [INFO] [binaryTest] 959
    [INFO] [binaryTest] 960
    [INFO] [binaryTest] 961
    [INFO] [binaryTest] 962
    [INFO] [binaryTest] 963
    [INFO] [binaryTest] 964
    [INFO] [binaryTest] 965
    [INFO] [binaryTest] 966
    [INFO] [binaryTest] 967
    [INFO] [binaryTest] 968
    [INFO] [binaryTest] 969
    [INFO] [binaryTest] 970
    [INFO] [binaryTest] 971
    [INFO] [binaryTest] 972
    [INFO] [binaryTest] 973
    [INFO] [binaryTest] 974
    [INFO] [binaryTest] 975
    [INFO] [binaryTest] 976
    [INFO] [binaryTest] 977
    [INFO] [binaryTest] 978
    [INFO] [binaryTest] 979
    [INFO] [binaryTest] 980
    [INFO] [binaryTest] 981
    [INFO] [binaryTest] 982
    [INFO] [binaryTest] 983
    [INFO] [binaryTest] 984
    [INFO] [binaryTest] 985
    [INFO] [binaryTest] 986
    [INFO] [binaryTest] 987
    [INFO] [binaryTest] 988
    [INFO] [binaryTest] 989
    [INFO] [binaryTest] 990
    [INFO] [binaryTest] 991
    [INFO] [binaryTest] 992
    [INFO] [binaryTest] 993
    [INFO] [binaryTest] 994
    [INFO] [binaryTest] 995
    [INFO] [binaryTest] 996
    [INFO] [binaryTest] 997
    [INFO] [binaryTest] 998
    [INFO] [binaryTest] 999
    [INFO] testing massive logical and - big values
    [INFO] testing massive logical or/big ints (can take a couple of minutes)
    [INFO] rtest N=15
    [INFO] rtest N=1024
    [INFO] rtest N=4096
    [INFO] rtest N=65536
    [INFO] rtest N=1048576
    [INFO] test contains
    [INFO] rr1.contains(1)= true
    [INFO] testing massive logical and
    [INFO] testing massive logical xor (can take a couple of minutes)
    [INFO] testing massive logical or (can take a couple of minutes)
    [INFO] FlipTest3A
    [INFO] FlipTest4A
    [INFO] FlipTest5A
    [INFO] FlipTest6A
    [INFO] FlipTest7A
    [INFO] FlipTest4
    [INFO] FlipTest5
    [INFO] FlipTest6
    [INFO] FlipTest7
    [INFO] 10000000
    [INFO] Tests run: 110, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.891 sec - in org.roaringbitmap.buffer.TestRoaringBitmap
    [INFO] Running org.roaringbitmap.buffer.TestMappeableBitmapContainer
    [INFO] runConstructorForBitmap
    [INFO] runConstructorForBitmap2
    [INFO] Tests run: 53, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.404 sec - in org.roaringbitmap.buffer.TestMappeableBitmapContainer
    [INFO] Running org.roaringbitmap.buffer.TestFastAggregation
    [INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.139 sec - in org.roaringbitmap.buffer.TestFastAggregation
    [INFO] Running org.roaringbitmap.buffer.TestRunContainer
    [INFO] andNotTest2
    [INFO] union2
    [INFO] run=[3,4]
    [INFO] array={0}
    [INFO] {0,3}
    [INFO] write safeSerialization
    [INFO] Tests run: 149, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.595 sec - in org.roaringbitmap.buffer.TestRunContainer
    [INFO] Running org.roaringbitmap.buffer.TestIterators
    [INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.602 sec - in org.roaringbitmap.buffer.TestIterators
    [INFO] Running org.roaringbitmap.buffer.TestMappeableArrayContainer
    [INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.147 sec - in org.roaringbitmap.buffer.TestMappeableArrayContainer
    [INFO] Running org.roaringbitmap.buffer.TestMemory
    [INFO] [testGCStability] testing GC stability with 10000 bitmaps containing ~500 values each on average
    [INFO] Universe size = 5000000
    [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.382 sec - in org.roaringbitmap.buffer.TestMemory
    [INFO] Running org.roaringbitmap.buffer.TestMemoryMapping
    [INFO] [TestMemoryMapping] Setting up memory-mapped file. (Can take some time.)
    [INFO] Running org.roaringbitmap.buffer.TestUtil
    [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.089 sec - in org.roaringbitmap.buffer.TestUtil
    [INFO] Running org.roaringbitmap.buffer.TestImmutableRoaringBitmap
    [INFO] test contains
    [INFO] test contains (runs too)
    [INFO] Running org.roaringbitmap.buffer.TestExamples
    [INFO] Created the bitmap {0,2,55,64,1073741824}
    [INFO] Serialized total count = 34 bytes
    [INFO] Mapped the bitmap {0,2,55,64,1073741824}
    [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.124 sec - in org.roaringbitmap.buffer.TestExamples
    [INFO] Running org.roaringbitmap.buffer.TestMappeableRunContainer
    [INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.14 sec - in org.roaringbitmap.buffer.TestMappeableRunContainer
    [INFO]
    [INFO] Results :
    [INFO]
    [INFO] Tests run: 1272, Failures: 0, Errors: 0, Skipped: 1
    [INFO]
    [INFO] [INFO] ------------------------------------------------------------------------
    [INFO] [INFO] Reactor Summary:
    [INFO] [INFO]
    [INFO] [INFO] RoaringBitmapParent ................................ SUCCESS [  5.370 s]
    [INFO] [INFO] RoaringBitmap ...................................... FAILURE [03:21 min]
    [INFO] [INFO] Real Roaring Dataset ............................... SKIPPED
    [INFO] [INFO] JMH benchmark : RoaringBitmap ...................... SKIPPED
    [INFO] [INFO] Memory benchmark : RoaringBitmap ................... SKIPPED
    [INFO] [INFO] ------------------------------------------------------------------------
    [INFO] [INFO] BUILD FAILURE
    [INFO] [INFO] ------------------------------------------------------------------------
    [INFO] [INFO] Total time: 03:28 min
    [INFO] [INFO] Finished at: 2017-12-19T13:20:27-05:00
    [INFO] [INFO] Final Memory: 22M/149M
    [INFO] [INFO] ------------------------------------------------------------------------
    [INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project RoaringBitmap: ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
    [INFO] [ERROR] Command was /bin/sh -c cd /Users/lemire/CVS/github/RoaringBitmap/roaringbitmap && /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/bin/java -Xmx1g -DBITMAP_TYPES=ROARING_ONLY -jar /Users/lemire/CVS/github/RoaringBitmap/roaringbitmap/target/surefire/surefirebooter4249507561081888175.jar /Users/lemire/CVS/github/RoaringBitmap/roaringbitmap/target/surefire/surefire7969507598368535865tmp /Users/lemire/CVS/github/RoaringBitmap/roaringbitmap/target/surefire/surefire_402030729637395650145tmp
    [INFO] [ERROR] -> [Help 1]
    [INFO] [ERROR]
    [INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [INFO] [ERROR]
    [INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    [INFO] [ERROR]
    [INFO] [ERROR] After correcting the problems, you can resume the build with the command
    [INFO] [ERROR]   mvn <goals> -rf :RoaringBitmap
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] RoaringBitmapParent ................................ FAILURE [03:38 min]
    [INFO] RoaringBitmap ...................................... SKIPPED
    [INFO] Real Roaring Dataset ............................... SKIPPED
    [INFO] JMH benchmark : RoaringBitmap ...................... SKIPPED
    [INFO] Memory benchmark : RoaringBitmap ................... SKIPPED
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 03:41 min
    [INFO] Finished at: 2017-12-19T13:20:27-05:00
    [INFO] Final Memory: 14M/83M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project RoaringBitmapParent: Maven execution failed, exit code: '1' -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
    
    bug 
    opened by lemire 27
  • clone smallest bitmap, adjust naive/workshy and thresholds

    clone smallest bitmap, adjust naive/workshy and thresholds

    This is based on observations made in Apache Pinot and separately in #608

    • for small numbers of bitmaps, naive_and can be faster than the more complex workShyAnd method
    • putting the smallest bitmap first in the aggregation can accelerate intersections
    opened by richardstartin 0
  • Add getContainerCount() method

    Add getContainerCount() method

    Is your feature request related to a problem? Please describe. In some instances, we want to sort bitmaps with respect to the number of containers they hold. See https://github.com/RoaringBitmap/RoaringBitmap/issues/608#issuecomment-1364722016

    Describe the solution you'd like We should add a function to our public API that gives convenient access to the number of containers.

    It would be as trivial as return highLowContainer.size(); though we want to cover both RoaringBitmap and ImmutableRoaringBitmap (and maybe the 64-bit bitmaps as well?). Proper documentation should be included.

    enhancement help wanted 
    opened by lemire 0
  • Optimise FastAggregation#and by cloning the lowest cardinality bitmap

    Optimise FastAggregation#and by cloning the lowest cardinality bitmap

    Is your feature request related to a problem? Please describe. I noticed that FastAggregation#and was consuming a lot of time in RoaringArray#clone. It turned out that I was anding bitmaps with greatly different cardinalities; e.g. on bitmap with 100k+ and another with < 100 bits set with an intersection of ~ 10 bits.

    Describe the solution you'd like It would be ideal if FastAggregation optimises this issue away. In a particular benchmark I'm running, selecting the bitmap with the lowest cardinality yields a ~4x performance improvement.

    Selecting the smallest bitmap isn't straightforward with the current interface of FastAggregation#and for the form with an Iterator as argument. But the array version could easily use this heuristic and adding a version with a List<RoaringBitmap> or Collection could also work. I'd be happy to contribute this if desired.

    The big question of course is what the cost of such optimisation is for cases with more homogeneous cardinalities. Any thoughts and feedback on this are welcome.

    enhancement 
    opened by frensjan 6
  •  Support reading records in roaringbitmap from iteratively serialized persistent files

    Support reading records in roaringbitmap from iteratively serialized persistent files

    Is your feature request related to a problem? Please describe. When we serialize a roaringbitmap to disk, we should design a method of iteratively reading records from disk, so that we don't have to read all the records at once, which is more friendly to memory.

    Describe the solution you'd like You can design a new class called diskroaringbitmap, or roaringbitmapreader, or directly add a method of iteratively reading records from disk files to the existing roaringbitmap.

    Please note that this is a community-based project. Consider proposing a fix (code, documentation) as a pull request.

    enhancement 
    opened by KeeProMise 2
  • Gh 590 immutable roarding64 navigable bitmap

    Gh 590 immutable roarding64 navigable bitmap

    SUMMARY

    This is draft, just to share my current work. There is failing test and I want to squash rebase anyway. It is just I had a lot less time than I expected the last two weeks.

    This pull request should introduce an new ImmutableRoaring64Bitmap. Considering such a structure maybe larger than 2gigabytes we can't use a single bytebuffer to open it. Instead it takes a RandomAccessFile and builds up the internal ImmutableRoaringBitmaps from mapped sections.

    Automated Checks

    • [ ] I have run ./gradlew test and made sure that my PR does not break any unit test.
    • [ ] I have run ./gradlew checkstyleMain or the equivalent and corrected the formatting warnings reported.
    opened by JervenBolleman 1
  • RangeBitmap inserts new values that occur unexpected results when building a RangeBitamp.Appender.

    RangeBitmap inserts new values that occur unexpected results when building a RangeBitamp.Appender.

    Describe the bug After using the appender build RangeBitmap, insert new values, then build a RangeBitmap again, there will occur unexpected results.

    To Reproduce **My test file: **

    import org.roaringbitmap.RangeBitmap;
    import org.roaringbitmap.RoaringBitmap;
    
    public class RangeBitmapTest {
    
        public static void printRoaringBitmap(String bitmapInfo, RoaringBitmap RBM){
            System.out.printf("\n" + bitmapInfo + " roaring bitmap values: ");
            for(int i : RBM) { System.out.printf("%d ", i); }
        }
    
        public static void main(String[] args) throws InterruptedException {
            System.out.printf("--------Range Bitmap Experiments1--------");
            RangeBitmap.Appender appender1 = RangeBitmap.appender(5_000L);
            appender1.add(1L);
            appender1.add(2L);
            RangeBitmap oldRangeBitmap = appender1.build();
            RoaringBitmap oldlte5Test = oldRangeBitmap.lte(5);
            printRoaringBitmap("lte5 old", oldlte5Test);
    
            // insert more numbers
            appender1.add(3L);
            appender1.add(4L);
            appender1.add(5L);
            RangeBitmap newRangeBitmap = appender1.build();
            RoaringBitmap newLte5Test = newRangeBitmap.lte(5);
            printRoaringBitmap("lte5 new", newLte5Test);
    
            RoaringBitmap newGte3Test = newRangeBitmap.gte(3);
            printRoaringBitmap("gte3 new", newGte3Test);
    
            RoaringBitmap newGte4Test = newRangeBitmap.gte(4);
            printRoaringBitmap("gte4 new", newGte4Test);
    
            System.out.printf("\n--------Range Bitmap Experiments2--------");
            RangeBitmap.Appender appender2 = RangeBitmap.appender(5_000L);
            for(long i = 1; i < 6; i++){
                appender2.add(i);
            }
            RangeBitmap test2RangeBitmap = appender2.build();
            RoaringBitmap gte4 = test2RangeBitmap.gte(4);
            printRoaringBitmap("gte4 ", gte4);
    
            RoaringBitmap lte5 = test2RangeBitmap.lte(5);
            printRoaringBitmap("lte5 ", lte5);
        }
    }
    

    These are the output results:

    --------Range Bitmap Experiments1-------- lte5 old roaring bitmap values: 0 1 lte5 new roaring bitmap values: 0 1 gte3 new roaring bitmap values: 2 3 4 gte4 new roaring bitmap values: 2 3 4 --------Range Bitmap Experiments2-------- gte4 roaring bitmap values: 3 4 lte5 roaring bitmap values: 0 1 2 3 4

    RoaringBitmap version:

    0.9.35

    Java version:

    JDK 11

    bug 
    opened by Josehokec 6
Releases(0.9.36)
Owner
Roaring bitmaps: A better compressed bitset
Roaring bitmaps are compressed bitmaps. They can be hundreds of times faster. (Picture credit: tambako)
Roaring bitmaps: A better compressed bitset
Bloofi: A java implementation of multidimensional Bloom filters

Bloofi: A java implementation of multidimensional Bloom filters Bloom filters are probabilistic data structures commonly used for approximate membersh

Daniel Lemire 71 Nov 2, 2022
A high performance caching library for Java

Caffeine is a high performance, near optimal caching library. For more details, see our user's guide and browse the API docs for the latest release. C

Ben Manes 13k Jan 5, 2023
Chronicle Bytes has a similar purpose to Java NIO's ByteBuffer with many extensions

Chronicle-Bytes Chronicle-Bytes Chronicle Bytes contains all the low level memory access wrappers. It is built on Chronicle Core’s direct memory and O

Chronicle Software : Open Source 334 Jan 1, 2023
High performance Java implementation of a Cuckoo filter - Apache Licensed

Cuckoo Filter For Java This library offers a similar interface to Guava's Bloom filters. In most cases it can be used interchangeably and has addition

Mark Gunlogson 161 Dec 30, 2022
An advanced, but easy to use, platform for writing functional applications in Java 8.

Getting Cyclops X (10) The latest version is cyclops:10.4.0 Stackoverflow tag cyclops-react Documentation (work in progress for Cyclops X) Integration

AOL 1.3k Dec 29, 2022
Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.

English | 中文 | Deutsch | Español | Ελληνικά | Français | 日本語 | Norsk (bokmål) | Português-Brasil | Русский | हिंदी Eclipse Collections is a comprehens

Eclipse Foundation 2.1k Dec 29, 2022
External-Memory Sorting in Java

Externalsortinginjava External-Memory Sorting in Java: useful to sort very large files using multiple cores and an external-memory algorithm. The vers

Daniel Lemire 235 Dec 29, 2022
A Java library for quickly and efficiently parsing and writing UUIDs

fast-uuid fast-uuid is a Java library for quickly and efficiently parsing and writing UUIDs. It yields the most dramatic performance gains when compar

Jon Chambers 142 Jan 1, 2023
Geohash utitlies in java

geo Java utility methods for geohashing. Status: production, available on Maven Central Maven site reports are here including javadoc. Add this to you

Dave Moten 386 Jan 1, 2023
Hollow is a java library and toolset for disseminating in-memory datasets from a single producer to many consumers for high performance read-only access.

Hollow Hollow is a java library and toolset for disseminating in-memory datasets from a single producer to many consumers for high performance read-on

Netflix, Inc. 1.1k Dec 25, 2022
High Performance Primitive Collections for Java

HPPC: High Performance Primitive Collections Collections of primitive types (maps, sets, stacks, lists) with open internals and an API twist (no java.

Carrot Search 890 Dec 28, 2022
Java port of a concurrent trie hash map implementation from the Scala collections library

About This is a Java port of a concurrent trie hash map implementation from the Scala collections library. It is almost a line-by-line conversion from

null 147 Oct 31, 2022
Java library for the HyperLogLog algorithm

java-hll A Java implementation of HyperLogLog whose goal is to be storage-compatible with other similar offerings from Aggregate Knowledge. NOTE: This

Aggregate Knowledge (a Neustar service) 296 Dec 30, 2022
A simple integer compression library in Java

JavaFastPFOR: A simple integer compression library in Java License This code is released under the Apache License Version 2.0 http://www.apache.org/li

Daniel Lemire 487 Dec 30, 2022
Java Collections till the last breadcrumb of memory and performance

Koloboke A family of projects around collections in Java (so far). The Koloboke Collections API A carefully designed extension of the Java Collections

Roman Leventov 967 Nov 14, 2022
Port of LevelDB to Java

LevelDB in Java This is a rewrite (port) of LevelDB in Java. This goal is to have a feature complete implementation that is within 10% of the performa

Dain Sundstrom 1.4k Dec 30, 2022
LMDB for Java

LMDB JNI LMDB JNI provide a Java API to LMDB which is an ultra-fast, ultra-compact key-value embedded data store developed by Symas for the OpenLDAP P

deephacks 201 Apr 6, 2022
Lightning Memory Database (LMDB) for Java: a low latency, transactional, sorted, embedded, key-value store

LMDB for Java LMDB offers: Transactions (full ACID semantics) Ordered keys (enabling very fast cursor-based iteration) Memory-mapped files (enabling o

null 680 Dec 23, 2022