[Performance] Use dynamic bitmaps in AlignedTVList#18264
Open
jt2594838 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Use dynamically selected bitmap implementations
Use
BitMap.createBitMapDynamicallyfor bitmap allocations created byAlignedTVListandLazyBitMap. With the defaultprimitive_array_size=64, this selects the long-backed implementation and avoids a separate byte-array allocation.Update bitmap memory accounting to use
ramBytesUsed(), and grow the time-deletion bitmap withextend.Preserve bitmap behavior
The long-backed implementation returns a copy from
getByteArray(). Result-status bitmap updates therefore usemergeinstead of mutating the returned array. The public byte-array helper keeps its previous exact-length result, including byte-aligned sizes.The all-value-deleted calculation reads each bitmap byte array once to avoid repeated temporary-array allocation.
Tests and performance
Added unit coverage for:
Added an opt-in local standalone performance IT. Workload: 256 aligned INT64 measurements, 64 rows per tablet, one null per measurement per tablet, 50 warmup batches, and 5 rounds of 100 batches.
Three independent JVM runs were compared using the median reported by each run:
new BitMap(64)createBitMapDynamically(64)The dynamic bitmap reduced round time by about 10.4% and increased throughput by about 11.6%.
This PR has:
Key changed/added classes
AlignedTVListLazyBitMapAlignedTVListTestIoTDBAlignedTVListBitMapPerformanceIT