On Tuesday, April 29, 2014 5:13:08 PM UTC+1, Jacob Quinn wrote:
>
> In my experience, I can think of a single time when having an array of a 
> specific abstract type was useful (how multiple Period arithmetic is 
> handled: 
> https://github.com/karbarcca/Dates.jl/blob/master/src/periods.jl#L88).
>
> Almost always, I'm concentrating on making sure Arrays I work with are of 
> a specific, concrete type to ensure performance and memory benefits. If I 
> really realize a few different types might make it in an Array, I usually 
> just go straight to a {} (Any Array) and move on.
>
> -Jacob
>
>
You will get performance and memory benefits if your arrays are homogeneous 
as opposed to heterogeneous. You don't always know what element type 
they'll have though. Sometimes you want Float64 for accuracy, sometimes 
Float32 for speed and lower memory use. To handle that you need a static 
function parameter, currently.

Reply via email to