Also note that adding types to function arguments doesn't improve performance. Just use the most general type that makes sense. Where having specific types matters is in *locations*: the types of globals, fields and arrays.
On Tue, Feb 3, 2015 at 11:35 AM, Tim Holy <[email protected]> wrote: > On Tuesday, February 03, 2015 08:15:40 AM Yuuki Soho wrote: > > In general don't hesitate to add type annotation to your functions, it > > often helps to prevent types problems (e.g. function > > test_1(μ::Float64,Δσ::Float64,σ::Float64) ). > > The cost is making your functions less general. Thanks to SIMD you can > often > get a 2x speedup by using Float32 instead of Float64; that alone is often a > reason to keep the functions agnostic about their input types. > > --Tim > >
