Stream: helpdesk (published)

Topic: `JET.@test_opt` vs `@code_warntype`


view this post on Zulip Filippos Christou (Dec 04 2023 at 23:18):

Without getting into the detail, can you please visually say if I need to invest the time to further optimize my code?

@code_warntype gives
p1.png

But JET.@test_opt gives
p2.png

@code_warntype looks okey. Some yellows but unions are rather small (3 elements max), so I assume the compiler flats them to if statements ?

If that's the case, I don't really get why JET says that dynamic dispatch will take place.

Is there a way to see whether dynamic dispatch is really happeping?

Profile view also looks also rather okey, right ? (No yellows and reds in the code)
p3.png

So, should I be afraid of the JET.@test_opt report ?

view this post on Zulip Filippos Christou (Dec 04 2023 at 23:22):

Just realized the JET report appears yellow-ish, so... maybe no red and danger, but only yellow and a friendly heads-up ?

view this post on Zulip Lilith Hafner (Dec 05 2023 at 16:45):

Without getting into the detail, can you please visually say if I need to invest the time to further optimize my code?

Looks reasonable to me. All code can be further optimized (or, at least, I haven't found any code that can't be). Whether or not it's worth doing depends mostly on whether the code is taking too long. If it's not a bottleneck then it's probably no worth your time to optimize it.

view this post on Zulip Filippos Christou (Dec 05 2023 at 16:55):

yeah, I am not after the julia dark magic optimizations. Just eliminating dynamic dispatch is enough but JET complains make me dubious.


Last updated: Nov 06 2024 at 04:40 UTC