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

**URL:** <https://discourse.julialang.org/t/how-reliable-are-the-warning-flags-in-the-vscode-profile-viewer/83325>\
**Category:** VS Code\
**Tags:** profiling\
**Created:** [June 25, 2022, 4:08am UTC](https://discourse.julialang.org/t/how-reliable-are-the-warning-flags-in-the-vscode-profile-viewer/83325 "2022-06-25T04:08:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benninkrs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/benninkrs/32/3191_2.png) [@benninkrs](https://discourse.julialang.org/u/benninkrs)\
**Post date:** [June 25, 2022, 4:08am UTC](https://discourse.julialang.org/t/how-reliable-are-the-warning-flags-in-the-vscode-profile-viewer/83325/1 "2022-06-25T04:08:08Z")

</div>

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](https://www.julia-vscode.org/docs/dev/userguide/profiler/):

> 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?

---

<div class="post-metadata">

**Author:** ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Post date:** [June 25, 2022, 2:00pm UTC](https://discourse.julialang.org/t/how-reliable-are-the-warning-flags-in-the-vscode-profile-viewer/83325/2 "2022-06-25T14:00:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [June 27, 2022, 7:14am UTC](https://discourse.julialang.org/t/how-reliable-are-the-warning-flags-in-the-vscode-profile-viewer/83325/3 "2022-06-27T07:14:23Z")

</div>

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.
