Oh, wait you meant that Matrix{Union(...)} should have same performance as 
Matrix{Number}?
Yes, I also assume that (I guess I should test).

But Union{Matrix{Float64}, Matrix{Number},...}
is fast.

---



On Friday, 12 June 2015 08:47:12 UTC+8, Lyndon White wrote:
>
>
>
> On Thursday, 11 June 2015 21:26:25 UTC+8, andrew cooke wrote:
>>
>>
>> i don't know of any docs that justify this, but i would assume that Union 
>> and Number would have very similar performance.
>>
>>
> You would be wrong.
> Union and {T<:Number} have similar performance.
> Number performed 1000x worse.
>
> For several reasons {T<:Number} is better, inclusing more sane error 
> messages, less having to type out all subtypes etc.
>

Reply via email to