-
Notifications
You must be signed in to change notification settings - Fork 998
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
Convert python values into proto values in bulk #2172
Conversation
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2172 +/- ##
=======================================
Coverage 84.58% 84.58%
=======================================
Files 102 102
Lines 8186 8195 +9
=======================================
+ Hits 6924 6932 +8
- Misses 1262 1263 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex <[email protected]>
My performance analysis was based on case proposed by @judahrand:
Dataset with 10 thousands rows was generated
Results: |
This looks great! |
""" | ||
# ToDo: make a better sample for type checks (more than one element) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind making an issue tracking this after the PR goes in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adchia, pyalex The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: pyalex [email protected]
What this PR does / why we need it:
Packing python native values (or NumPy arrays) into proto objects (generated proto classes) takes roughly 80% of the time during materialization (not counting offline / online storage part). Ironically protobuf serialization itself takes around 10% of the time.
This PR refactors
python_values_to_proto_values
function to process data in bulk (essentially column by column), which improves performance by running all type checks only once (per batch / column). According to my analysis, this move will decrease packing time roughly by 50% without introducing significant changes (see first comment).Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: