That’s not too easy to answer - speaking purely semantically, it doesn’t matter. Generally though, if a struct is immutable and consists of only isbits
, yes. For structs containing some mutable container/struct, there may be a reference to that data involved. This of course assumes that the called function is not inlined - if it is, nothing of the sort of passing around will be necessary. It should be noted that julia is quite aggressive when it comes to inlining. For more information on julias’ internal calling conventions, you can check out the developer documentation on calling conventions.
I should note though that trying to think in terms of registers when looking at julia source code is most likely not helpful at all (and will probably give you slightly wrong intuition) about when julia is fast and when it’s slow. It’s more helpful knowing when julia will SIMD and when it will not, when it will allocate and when it won’t, as well as how your data is laid out in memory to take more advantage of cache coherence.