Hello Julia users,

I have been using the profiler in an attempt to identify where my code
spends most of its time.  When I run the profiler, I get a large
number of calls into inference.jl.  Here are the first (approximately)
10 lines of my profile report:

julia> Profile.print(format=:flat)

 Count File                                                                     
         Function               Line
    24 ./base.jl                                                                
         finalizer                72
    55 ./base.jl                                                                
         finalizer                75
     1 ./inference.jl                                                           
         abstract_apply          811
     1 ./inference.jl                                                           
         abstract_call           848
    72 ./inference.jl                                                           
         abstract_call           879
     2 ./inference.jl                                                           
         abstract_call           896
     3 ./inference.jl                                                           
         abstract_call_gf        676
    69 ./inference.jl                                                           
         abstract_call_gf        737
    83 ./inference.jl                                                           
         abstract_eval           961
    11 ./inference.jl                                                           
         abstract_eval_call      906
    72 ./inference.jl                                                           
         abstract_eval_call      934

The profile report goes on from there.  The report shows I have many
more inference calls, as well as calls to other functions in my
program.

My questions:

*  Based on the above report, I guess that the compiler is doing a lot
   of guessing about types I am using in my program.  Is that correct?
   Or does a well-typed program also have lots of calls into
   inference.jl?

*  If I need to nail down my variable types better (to eliminate type
   instability and get better performance), what is the recommended
   way to identify variables or locations in the code where types
   should be better defined?  A pointer to blog posts or documentation
   is a fine way to answer this question.  But I'm wondering if there
   are "lint"-type tools which identify uncertain types in Julia code?

Thanks for your thoughts,

Stuart


Reply via email to