-
Notifications
You must be signed in to change notification settings - Fork 315
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
PicklingUdfWrapper cache type information #689
Conversation
@@ -35,16 +42,19 @@ internal object Execute(int splitIndex, object[] input, int[] argOffsets) | |||
[UdfWrapper] | |||
internal class PicklingUdfWrapper<T, TResult> | |||
{ | |||
[NonSerialized] | |||
private readonly bool?[] _sameT = new bool?[1]; |
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.
No need to create an array?
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.
all values in the array will have default values. The default value of a Nullable
is null
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.
Oh I meant that this has only one element, so no need to create an array.
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.
ah got it. Changed it to use a non array for the 1 param case.
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, thanks @suhsteve!
Cache parameter type information to determine if converting/casting is necessary. This will help speed up the call if the Type only needs to be casted.
#683