There is most certainly a type problem. You're not getting type information
for sparse_grid.lvl_l which deoptimizes a lot of things. In your code, you
have:
type sparse_grid d::Int64 q::Int64 n::Int64 grid
::Array{Float64} ind::Array{Int64} lvl::Array{Int64}
lvl_l::Array{Int64} lvl_s::Array{Float64} bounds::Array{
Float64} gtype B Bf ubend
Try specifying the number of dimensions for the arrays, e.g.
grid::Array{Float64,2}. Also using any of the untyped fields will slow code
down, but I don't see them in that function.
A hackish way to find type issues is:
filter!(x->!isleaftype(x[2]), @code_typed(f(args))[1].args[2][2])
which returns a list of variables where type inference couldn't infer a
concrete/leaf type. In some cases these will be "hidden" variables so you
may still need to inspect the output of code_typed. TypeCheck.jl and
Lint.jl may also provide more sophisticated tools for this purpose.
Simon
On Monday, September 15, 2014 5:16:36 AM UTC-4, Zac wrote:
>
> https://gist.github.com/Zac12345/519bd7a503a1fd1b8d98 has the updated
> function and code_typed output
>
> Pkg.clone("https://github.com/Zac12345/Sparse") should be fine for the
> test as the gist does'nt require functions using the shared lib.
>
> Are there any specific things i should be looking for in the code_typed
> results?
>