Ah ja @code_warntype is in Julia v0.4. I thin in 0.3 you could just do @code_type and look for ::Any
See the introduction PR https://github.com/JuliaLang/julia/pull/9349 On Sunday, 20 September 2015 23:49:55 UTC+9, Daniel Carrera wrote: > > Uhmm... I get an error: > > ERROR: @code_warntype not defined > > Do I need to update Julia or something? I have version 0.3.11. > > On 20 September 2015 at 16:14, Valentin Churavy <[email protected] > <javascript:>> wrote: > >> 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]> >>> 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.) >>> >>> >>> >
