-
Notifications
You must be signed in to change notification settings - Fork 8
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
Assigning SVector and Tuples are allocating #1015
Comments
@charleskawczynski I tried something similar and it seems like Tuples and NamedTuples are OK now:
with output |
Can you try y .= return_tuple.(val).:1
z .= return_tuple.(val).:2 ? |
Yes! I changed to this:
and it seems ~2x as worse? "Floats" = "Floats" Maybe because it now allocates a Tuple valued field twice, and just extracts one element from it each time for the broadcast assignment statements? |
The last one in theory shouldn't be allocating, so I guess it's still an issue. I'm pretty sure that using a struct in this situation will not result in allocations here. |
I am missing something, Im sure, but |
That's true, but it should be stack allocated because only one component is ever needed in the final expression. |
Here's a MWE:
The text was updated successfully, but these errors were encountered: