Skip to content

[core] Keep the rbm32 and rbm64 union decoded between rows - #1568

Open
JeonDaehong wants to merge 1 commit into
apache:mainfrom
JeonDaehong:rbm-keep-decoded-union
Open

JeonDaehong wants to merge 1 commit into
apache:mainfrom
JeonDaehong:rbm-keep-decoded-union

Conversation

@JeonDaehong

Copy link
Copy Markdown
Contributor

Purpose

Closes #1567.

rbm32 and rbm64 deserialized and re-serialized the accumulated bitmap for every row, so a key with many rows took time quadratic in its bitmap size.

Brief change log

  • The accumulator keeps the first input as bytes. The second input decodes it once, and later inputs are unioned into the decoded bitmap.
  • result() serializes the union. A lone input is still returned unchanged.

Tests

keeps_a_lone_input_and_resets_the_union in both files checks that a lone Java input is returned byte for byte, that the union is right, and that reset clears it.

Measured on c7i.8xlarge, release build, main and this branch alternated 3 times (ranges across runs). The output bytes hash the same on both for every shape.

Writing one commit through a table with rbm32:

rows main this PR
1 key × 100,000 7,053–7,066 ms 144–145 ms
100 keys × 1,000 204–205 ms 94 ms
100,000 keys × 3 288–291 ms 266–276 ms

Aggregating directly, 1 key with N single-value bitmaps:

N rbm32 main rbm32 PR rbm64 main rbm64 PR
10,000 84 ms 10–11 ms 337–339 ms 15 ms
100,000 7,120–7,123 ms 116 ms 31,030–31,077 ms 163–164 ms

One input per key is unchanged (25–26 ms for 100,000 keys either way). Three inputs per key, 100,000 keys: rbm32 81 → 60 ms, rbm64 129 → 98 ms.

API and Format

No public API or storage format changes.

Documentation

None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rbm32 and rbm64 aggregation re-serialize the bitmap for every row

1 participant