Add struct/row proxy objects via useProxy option. #12
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.
Struct
types and table row objects as zero-copy proxy objects with getter properties that retrieve data directly from underlying Arrow batches. This representation is enabled by passing auseProxy
option to thetableFromIPC
method. These proxies require substantially less memory and are faster for single-access use, but do not support object manipulation methods such asObject.keys
,Object.values
, and spreading{ ...object }
.The proxy representation follows the strategy of the Vega arrow loader and suggestions from @mcovalt.
Benchmarks show non-trivial performance improvements (25-35% reduced running time) for these proxy objects vs. vanilla JS objects: 26.72ms vs. 40.23ms for flights.arrows and 441.24ms vs. 576.23ms for scrabble.arrows. However, due to their simplicity and convenience methods, this PR leaves vanilla objects as the default object representation (hence the opt-in via
useProxy
). Both methods in Flechette remain substantially faster than the Arrow-JS reference implementation.