take a look at
@code_warntype calc_net(0, 0, 0, Dict{String,Float64}(), Dict{String,Float64
}())
It tells you where the compiler has problems inferring the types of the
variables.
Problematic in this case is
b_hist::Any
b_hist_col2::Any
numB::Any
b_hist_col2_A::Any
b_hist_col2_B::Any
total_b_A_::Any
total_b_B_::Any
net_::Any
On Sunday, 20 September 2015 22:55:50 UTC+9, Daniel Carrera wrote:
>
> Hi Steven,
>
> I am not the OP, I am trying to help the OP with his code. Anyway, the
> first thing I did was replace Dict{Any,Any} by the more explicit
> Dict{String,Float64} but that didn't help. I did not think to try a
> composite type. I might try that later. It would be interesting to figure
> out why the OP's code is so much slower in Julia.
>
> Cheers,
> Daniel.
>
>
> On 20 September 2015 at 15:20, Steven G. Johnson <[email protected]
> <javascript:>> wrote:
>
>> Daniel, you are still using a Dict of params, which kills type inference.
>> Pass parameters directly or put them in (typed) fields of a composite type.
>>
>> (On the other hand, common misconception: there is no performance need to
>> declare the types of function arguments.)
>
>
>