How to detect type unstable functions in Julia

You could try TypeCheck.jl on bits the profiler say are slow.

Julia 0.4 has @code_warntype as well.


In addition to the excellent suggestions of IainDunning, running julia with --track-allocation=user and analyzing the results with analyze_malloc from the Coverage package is a good way to quickly get a high-level overview. The principle is that type-instability triggers memory allocation, so looking for lines of code that have unexpected, large allocations is a good way to find the most egregious instances of type instability.

You can find more information about track-allocation in the manual, and even more performance-analysis options described.

Tags:

Julia