Adds an option for representing 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 a useProxy option to the tableFromIPC method. These proxies require substantially less memory and are faster for single-access use, but do not support object manipulation methods such as Object.keys, Object.values, and spreading { ...object }.
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.
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.