Add IntBuffer and DoubleBuffer entry types to MapBuffer (#57359)#57359
Open
javache wants to merge 1 commit into
Open
Add IntBuffer and DoubleBuffer entry types to MapBuffer (#57359)#57359javache wants to merge 1 commit into
javache wants to merge 1 commit into
Conversation
|
@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109848476. |
Summary: Adds two new MapBuffer entry types, `IntBuffer` and `DoubleBuffer`, for storing homogeneous arrays of ints and doubles compactly in the dynamic data section. Unlike `Map` / map lists, these carry no per-element key/type overhead: a batch of N values costs ~N*elementSize bytes plus a single 4-byte count prefix instead of N 12-byte buckets. The bucket value holds the offset of the array within the dynamic data section. Covers the full surface: the C++ reader (`MapBuffer::getIntBuffer` / `getDoubleBuffer`), the C++ builder (`MapBufferBuilder::putIntBuffer` / `putDoubleBuffer`), and the Kotlin reader API (`MapBuffer.getIntBuffer` / `getDoubleBuffer`, `Entry.intBufferValue` / `doubleBufferValue`). The `DataType` enum gains `IntBuffer = 6` and `DoubleBuffer = 7`, kept in sync across C++ and Kotlin. Changelog: [General][Added] - Add `IntBuffer` and `DoubleBuffer` entry types to MapBuffer for compact homogeneous int/double arrays Differential Revision: D109848476
a7e7fd8 to
d49129e
Compare
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.
Summary:
Adds two new MapBuffer entry types,
IntBufferandDoubleBuffer, for storing homogeneous arrays of ints and doubles compactly in the dynamic data section. UnlikeMap/ map lists, these carry no per-element key/type overhead: a batch of N values costs ~N*elementSize bytes plus a single 4-byte count prefix instead of N 12-byte buckets. The bucket value holds the offset of the array within the dynamic data section.Covers the full surface: the C++ reader (
MapBuffer::getIntBuffer/getDoubleBuffer), the C++ builder (MapBufferBuilder::putIntBuffer/putDoubleBuffer), and the Kotlin reader API (MapBuffer.getIntBuffer/getDoubleBuffer,Entry.intBufferValue/doubleBufferValue). TheDataTypeenum gainsIntBuffer = 6andDoubleBuffer = 7, kept in sync across C++ and Kotlin.Changelog:
[General][Added] - Add
IntBufferandDoubleBufferentry types to MapBuffer for compact homogeneous int/double arraysDifferential Revision: D109848476