-
Notifications
You must be signed in to change notification settings - Fork 915
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
Reduce redundant code in CUDF JNI #10019
Reduce redundant code in CUDF JNI #10019
Conversation
Also, remove repeated code, fix unique_ptr usage.
1. Memory leak in hashing JNI code. 2. Removed convoluted/unnecessary uses of std::unique_ptr. 3. Removed unnecessary uses of std::move. 4. Moved repeated std::transform() for column/column_view conversions to utility function. 5. Removed unnecessary variables, shortened jlong casting. Yet to address memory leak from bitwiseMergeAndSetValidity.
Plus, review comments: 1. Renamed `to_jlong(unique_ptr)` to `release_as_jlong(unique_ptr)`. 2. Copyright dates. Signed-off-by: MithunR <[email protected]>
Codecov Report
@@ Coverage Diff @@
## branch-22.04 #10019 +/- ##
================================================
+ Coverage 10.37% 10.42% +0.04%
================================================
Files 119 119
Lines 20149 20609 +460
================================================
+ Hits 2091 2148 +57
- Misses 18058 18461 +403
Continue to review full report at Codecov.
|
Though it could stand to be improved, I think I'll leave |
Converted native_jbooleanArray into a separate class. Added utilities for extracting std::vectors, transform_if_else(), etc. Signed-off-by: MithunR <[email protected]>
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.
Looking really good
Removed explicit loops in map initialization. More to_jlong() fixes. Signed-off-by: MithunR <[email protected]>
I've rebased this on |
Rerun tests |
I just noticed that there are a number of |
The ones I left alone (e.g. the join code you added most recently) seemed fine to my eye, at the time. I should probably make another pass and confirm. Perhaps reconsider avoiding changes to |
These occurrences have been removed from |
Rebased to latest, including #10040. Waiting on CI before merging. |
@gpucibot merge |
This commit cleans up some of the redundancy in CUDF JNI native code, and modifies some of the
unique_ptr
handling:Improvements
native_jpointerArray<column_view>
tovector<column_view>
. Removed redundant code instringConcat
functions.unique_ptr<column>
tojlong
. This eliminates variables from nearly all the JNI functions.std::vector
fromnative_jArray
classes. This reduces raw loops inTableJni.cpp
.unique_ptr
in locations where they are immediatelyrelease()
d. (E.g.ColumnVectorJni::getNativeColumnView()
.)std::move()
calls.reinterpret_cast
(E.g. incopyColumnViewToCV()
.)typedef
->using
.