Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add struct/row proxy objects via useProxy option. #15

Merged
merged 1 commit into from
Sep 11, 2024
Merged

Add struct/row proxy objects via useProxy option. #15

merged 1 commit into from
Sep 11, 2024

Conversation

jheer
Copy link
Member

@jheer jheer commented Sep 11, 2024

  • 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 table generation methods. 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 }.

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.

@jheer jheer changed the title Add struct/row object proxies. Add struct/row proxy objects via useProxy option. Sep 11, 2024
@jheer jheer merged commit a2dd7f1 into main Sep 11, 2024
2 checks passed
@jheer jheer deleted the jh/proxy branch September 11, 2024 20:21
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.

1 participant