Profiling compilation/inference

Profiling inference is basically like other forms of profiling, with the exception that of course you can only do it in a fresh session. Let’s say that @snoopi identifies a particular call that you’re interested in; then restart Julia and do @profile f(args...) and then check the result. Because inference is recursive, this doesn’t always give you everything you might want, but if it turns out the bottleneck is in a very specific step then it will jump out at you.

What “top level” means is basically the call from which inference was entered. If you have a call that will require runtime method dispatch, that will return to top level.

2 Likes