Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roaring: implement ToDense and FromDense #408

Merged
merged 11 commits into from
Dec 18, 2023
Merged

Commits on Dec 16, 2023

  1. roaring: implement ToDense and WriteDenseTo

    This commit introduces ToDense and WriteDenseTo as methods in Bitmap.
    They make conversion to dense bitmaps like https://github.com/bits-and-blooms/bitset
    or https://github.com/kelindar/bitmap performant and simple.
    
    ```
    name                                     time/op
    WriteDenseTo/bitmap-4097-10                 135ns ± 2%
    WriteDenseTo/run-4097-10                   40.2ns ± 0%
    WriteDenseTo/array-4096-10                 8.74µs ± 0%
    WriteDenseTo/bitmaps-and-runs-300000-10    2.29µs ± 0%
    
    name                                     speed
    WriteDenseTo/bitmap-4097-10              68.2GB/s ± 2%
    WriteDenseTo/run-4097-10                 25.7GB/s ± 0%
    WriteDenseTo/array-4096-10               1.05GB/s ± 0%
    WriteDenseTo/bitmaps-and-runs-300000-10  24.6GB/s ± 0%
    
    name                                     alloc/op
    WriteDenseTo/bitmap-4097-10                 0.00B
    WriteDenseTo/run-4097-10                    0.00B
    WriteDenseTo/array-4096-10                  0.00B
    WriteDenseTo/bitmaps-and-runs-300000-10     0.00B
    
    name                                     allocs/op
    WriteDenseTo/bitmap-4097-10                  0.00
    WriteDenseTo/run-4097-10                     0.00
    WriteDenseTo/array-4096-10                   0.00
    WriteDenseTo/bitmaps-and-runs-300000-10      0.00
    ```
    tsenart committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    b2e3822 View commit details
    Browse the repository at this point in the history
  2. fixup! tweaks

    tsenart committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    d4523d2 View commit details
    Browse the repository at this point in the history
  3. fixup! check zero

    tsenart committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    79c26b6 View commit details
    Browse the repository at this point in the history
  4. fixup! reuse size

    tsenart committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    276b72f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1c0c796 View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2023

  1. fixup! no need to zero out

    ```
    name                                     time/op
    WriteDenseTo/bitmap-4097-10                17.0ns ± 0%
    WriteDenseTo/run-4097-10                   29.4ns ± 0%
    WriteDenseTo/array-4096-10                 8.65µs ± 0%
    WriteDenseTo/bitmaps-and-runs-300000-10    1.52µs ± 0%
    
    name                                     speed
    WriteDenseTo/bitmap-4097-10               542GB/s ± 0%
    WriteDenseTo/run-4097-10                 35.1GB/s ± 0%
    WriteDenseTo/array-4096-10               1.07GB/s ± 0%
    WriteDenseTo/bitmaps-and-runs-300000-10  36.9GB/s ± 0%
    
    name                                     alloc/op
    WriteDenseTo/bitmap-4097-10                 0.00B
    WriteDenseTo/run-4097-10                    0.00B
    WriteDenseTo/array-4096-10                  0.00B
    WriteDenseTo/bitmaps-and-runs-300000-10     0.00B
    
    name                                     allocs/op
    WriteDenseTo/bitmap-4097-10                  0.00
    WriteDenseTo/run-4097-10                     0.00
    WriteDenseTo/array-4096-10                   0.00
    WriteDenseTo/bitmaps-and-runs-300000-10      0.00
    ```
    tsenart committed Dec 17, 2023
    Configuration menu
    Copy the full SHA
    e672a24 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d8df7c9 View commit details
    Browse the repository at this point in the history
  3. fixup! implement FromDense

    tsenart committed Dec 17, 2023
    Configuration menu
    Copy the full SHA
    4e45a46 View commit details
    Browse the repository at this point in the history
  4. fixup! honor arrayDefaultMaxSize invariant

    ```
    name \ time/op                        before         with-efficient-container  no-to-efficient-container
    FromDense/bitmap-4097-10                1.45µs ± 1%               2.15µs ± 0%                1.47µs ± 2%
    FromDense/run-4098-10                   1.04µs ± 4%               3.00µs ± 0%                1.04µs ± 2%
    FromDense/array-4096-10                 1.45µs ± 1%               6.47µs ± 8%                5.46µs ± 1%
    FromDense/bitmaps-and-runs-300000-10    3.53µs ± 0%              13.53µs ± 1%                3.57µs ± 1%
    
    name \ speed                          before         with-efficient-container  no-to-efficient-container
    FromDense/bitmap-4097-10              6.35GB/s ± 1%             4.28GB/s ± 0%              6.27GB/s ± 2%
    FromDense/run-4098-10                  989MB/s ± 4%              345MB/s ± 0%               990MB/s ± 2%
    FromDense/array-4096-10               6.36GB/s ± 1%             1.43GB/s ± 8%              1.69GB/s ± 1%
    FromDense/bitmaps-and-runs-300000-10  15.9GB/s ± 0%              4.2GB/s ± 1%              15.8GB/s ± 1%
    
    name \ alloc/op                       before         with-efficient-container  no-to-efficient-container
    FromDense/bitmap-4097-10                8.22kB ± 0%               8.22kB ± 0%                8.22kB ± 0%
    FromDense/run-4098-10                   8.22kB ± 0%               8.26kB ± 0%                8.22kB ± 0%
    FromDense/array-4096-10                 8.22kB ± 0%              16.44kB ± 0%               16.41kB ± 0%
    FromDense/bitmaps-and-runs-300000-10    8.35kB ± 0%               8.49kB ± 0%                8.35kB ± 0%
    
    name \ allocs/op                      before         with-efficient-container  no-to-efficient-container
    FromDense/bitmap-4097-10                  2.00 ± 0%                 2.00 ± 0%                  2.00 ± 0%
    FromDense/run-4098-10                     2.00 ± 0%                 4.00 ± 0%                  2.00 ± 0%
    FromDense/array-4096-10                   2.00 ± 0%                 4.00 ± 0%                  3.00 ± 0%
    FromDense/bitmaps-and-runs-300000-10      6.00 ± 0%                16.00 ± 0%                  6.00 ± 0%
    ```
    tsenart committed Dec 17, 2023
    Configuration menu
    Copy the full SHA
    d82c20d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0b79b20 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3d497d5 View commit details
    Browse the repository at this point in the history