Is there a quick way to list functions that are not type stable during execution in a given module? I’m aware of the @code_warntype macro, or the Cthulu package, but it can be quite cumbersome to descend into all functions and test them one by one.
Not really answering your question but this recent paper on “Type Stability in Julia” might interest you. Apart from the formal part (which, frankly, I didn’t try to understand), they also seem to have systematically analyzed the type stability of several Julia packages. I would assume that the tools / the code with which they did it is accessible somewhere.
@ulysses (first author of the paper): First of all, cool analysis! Do you think that the tool that you used to analyze the type (in)stability of methods of a package could be made a Julia package? Ideally, this would make it easy for people to analyze their own packages.
@carstenbauer thanks for mentioning it! I do think that the tool can be useful for this scenario. One caveat is that we were aiming at bulk data processing so the interface is geared towards: we generate some CSV files and you go and figure it. But that’s may be fine, actually. Writing up how one would analyze a single package using the tool was always on my TODO list but I never got to it. Maybe I should.
Jet.jl and @report_opt definitely looks like the right tool for my use case, however it is a bit verbose and doesn’t seem to catch all the issues with type-unstable functions in my package (I haven’t tried to narrow it down to a MWE though).
@ulysses impressive work! A user-friendly tool for analyzing packages based on this would be amazing!