If you don't watch out you start believing some code is expensive while it is not. But percentage of cpu time might often be displayed on wrong source code line. So confusing. Don't understand why they are doing that. Are they blind or am I blind. Or visual studio so complex that they can't do good testing. O wait maybe they are using me as a tester.
Terrible did rewriting of certain code parts for nothing.
Visual studio community 2022 version 17.4.3 Performance profiler giving percentages at wrong source code line
Moderator: Ras
-
- Posts: 7251
- Joined: Mon May 27, 2013 10:31 am
-
- Posts: 253
- Joined: Mon Aug 26, 2019 4:34 pm
- Location: Clearwater, Florida USA
- Full name: JoAnn Peeler
Re: Visual studio community 2022 version 17.4.3 Performance profiler giving percentages at wrong source code line
Thanks for the heads up! I have been using dotTrace as my profiler, but the most recent version no longer seems to give me per line performance. It could be user-error, but I was thinking about dropping back to the VS profiler.
-
- Posts: 4624
- Joined: Tue Apr 03, 2012 4:28 pm
- Location: Midi-Pyrénées
- Full name: Christopher Whittington
Re: Visual studio community 2022 version 17.4.3 Performance profiler giving percentages at wrong source code line
If you’re profiling optimised code, the profiler can’t necessarily define exactly which code line the assembly is executing.Henk wrote: ↑Mon Jan 09, 2023 12:48 pm If you don't watch out you start believing some code is expensive while it is not. But percentage of cpu time might often be displayed on wrong source code line. So confusing. Don't understand why they are doing that. Are they blind or am I blind. Or visual studio so complex that they can't do good testing. O wait maybe they are using me as a tester.
Terrible did rewriting of certain code parts for nothing.
-
- Posts: 7251
- Joined: Mon May 27, 2013 10:31 am
Re: Visual studio community 2022 version 17.4.3 Performance profiler giving percentages at wrong source code line
Ok. So they can fix it with a warning. "Warning: You are using optimized code. Do you still want to view the percentages?". Or something.
-
- Posts: 4624
- Joined: Tue Apr 03, 2012 4:28 pm
- Location: Midi-Pyrénées
- Full name: Christopher Whittington
Re: Visual studio community 2022 version 17.4.3 Performance profiler giving percentages at wrong source code line
But, the purpose of profile performance is presumably to find places to make the code faster, it really only makes sense to profile the optimised version.
-
- Posts: 1062
- Joined: Tue Apr 28, 2020 10:03 pm
- Full name: Daniel Infuehr
Re: Visual studio community 2022 version 17.4.3 Performance profiler giving percentages at wrong source code line
Use compiler explorer and see what your function compiles into.
You will see that in release builds your lines and the assembly don't map to each other. Stuff gets blended, removed, reordered with other lines and functions etc. so that's why working at the "performance per line" in visualstudio is not the way to go for advanced microoptimisations.
You will see that in release builds your lines and the assembly don't map to each other. Stuff gets blended, removed, reordered with other lines and functions etc. so that's why working at the "performance per line" in visualstudio is not the way to go for advanced microoptimisations.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Daniel Inführ - Software Developer