How reliable are the warning flags in the vscode profile viewer?

I’m profiling a function using the vscode-julia @profview macro. When I do this some lines in the function are flagged as dynamic dispatch which I have a hard time believing, since according to @code_warntype the arguments to the flagged function calls have known types. Then I read this line in the documentation:

There are some heuristics for special flags like garbage collection, dynamic dispatch, and more

Does “heuristic” here mean that the occurrence of dynamic dispatch is merely guessed, not definitely determined? How much can I rely on the gc and dispatch flags in the vscode profiler viewer?

1 Like

They tend to be accurate in my experience. Try using JET.jl or ctulhu.jl to get more precise checks

2 Likes

Those two flags should be fairly reliable. Functions are marked with the GC flag when they end up calling jl_gc_*; runtime dispatch looks for jl_invoke/_jl_apply_generic instead. It’s possible that those checks aren’t exhaustive (especially on newer Julia versions), but I don’t they’ll give you false-positives.