-
Notifications
You must be signed in to change notification settings - Fork 149
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
Change README rule of thumb #506
Comments
Yes... it's hard to condense down all the nuances into a sentence or two for new users. I'm definitely open to suggestions! Out of curiousity, how high dimensional are these |
An
so that X is a subset of R^20. I can do global optimization of a function R^N -> R with, say, N=200, except that compiling the code takes ages. I'm not sure up to which value of N the calculation would run in a reasonable time if the compile-time penalty were less significant. I'm happy to give more details. |
OK, yep. Also note #494. The long-term goal here has always been to use loops and so-on for larger arrays, which would solve the compilation time issue. For PS: random thought, what about the syntax |
already works (but you don't want to do that for 50 of them) ;) Slight abuse of the × operator maybe. I also wonder about heap vs stack, but it doesn't seem to be something that's easy to play with? |
Try compare |
MVector is still backed by a tuple? Its storage is still stack-allocated and it's just the wrapper type that gets allocated each time though?
DiffEq has both inplace and out-of-place routes, both optimized respectively. That would probably be a good "full program" perspective as to where it's a good spot to cut it off. We can make a test that is a PDE discretization of N points and find the switching point N. |
MVector is stored on the heap (that's why you can mutate it). |
The README says:
In Julia v1.0 there were some pretty big changes to tuple optimizations, for example JuliaLang/julia#27398 . Since SVectors are backed by tuples, this seemed to have a pretty big effect on large static arrays. For example, 11x11 used to be over the tuple inference limit, counter acted by some of the nice generated functions in StaticArrays.jl, and that made them seem to match. But without that inference limit, 11x11 seems to be much better than before.
@dpsanders mentioned in Slack
I think it might be worth re-evaluating the rule of thumb for the README since now the definition of "small" may have shifted. In another sense, "small" seems to have shifted high enough that now it's a discussion of runtime vs compilation time (compilation time can grow pretty fast for much larger static arrays, once again quoting @dpsanders
). So a more nuanced discussion is probably needed in Julia v1.0 land, and I think this is important since that 11x11 number is something I and others copy around as a nice heuristic which may now be old!
The text was updated successfully, but these errors were encountered: