@Erik Schnetter
Would you suggest:
type Packet{T}
ID:::Vector{T}
position::Vector{Vector3{T}}
direction::Vector{Vector3{T}}
energy::Vector{T}
time:::Vector{T}
end
instead of Vector{Packet} ?
Is this, because Packet is to big for the registers, but Vector3 alone
might fit?
I made simple benchmark to test this hypothesis, but I'm not sure if I
implemented them to correctly test this assumption.
The results where, that it doesn't make a difference.
https://gist.github.com/SimonDanisch/50a1fd0a7672bade57ea
Am Mittwoch, 14. Januar 2015 05:34:55 UTC+1 schrieb [email protected]:
>
> I am writing a monte carlo radiation transport code (for applications in
> astrophysics), where I follow the temporal and spacial evolution of
> millions of whats called "monte-carlo packets". And I am wondering whether
> if I should use the Julia's type system, if so how should I implement it
> and also if there is any performance loss/gain.
>
> Let's say I define a type like following (based on this example tutorial
> <http://forio.com/labs/julia-studio/tutorials/advanced/1/>):
>
> type Packet{T}
>> ID::{T}
>> position::Vector{T}
>> direction::Vector{T}
>> energy::{T}
>> time::{T}
>> end
>
>
> obviously this could make the code much more easier to read than a version
> with all information represented in separate arrays. But beside this
> elegance, is there anything else I should know about types? when I apply
> this to millions of objects will there be any effect to the performance?
>
> thanks,
>