-
Notifications
You must be signed in to change notification settings - Fork 738
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 time dictionary coercions #6208
Conversation
I wonder if we want to reduce the codegen by coercing to the corresponding primitive array type and then coercing this to a dictionary |
Sorry I'm not sure I follow. Are you worried about the verbosity of handling all of these cases? |
Rust generics are monomorphised so if you call a generic function with lots of different parameters it leads to lots of additional codegen hurting compile times and bloating your binary. I'm suggesting rather than instantiating the cast code for every value type, we instead use the existing code to coerce to integers and then to dictionaries |
Oh right that sort of code gen. Since this is all internal, could we go with the pattern in place now and punt on a larger refactor? |
I don't think you need a major refactor, just something along these lines (maybe extracted into a function to reduce the duplication)
The performance should be completely dominated by the dictionary computation for non-trivial arrays, and therefore the additional dispatch logic irrelevant.
As written this PR will fairly drastically increase the amount of codegen, you have to understand this code is instantiated for all 8 dictionary key types, so I think it is important we try to keep this under control. |
Got it now! I was able to make a standalone function using your example code. It also helped reduce code duplication a lot. |
@tustvold looks like CI passed and this is approved, mind merging? |
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 description provided.