1

I may just be using this program wrong, but I've been having a lot of difficulty using the C++ profiler on MacOS. There are two major issues:

  1. I'd preferably like to see line-by-line annotations of where time is spent not just per-function. I haven't figured out how to do this.
  2. When I look at the per-function annotations, the function annotation is so large it pushes the function name off the screen, and Instruments doesn't seem to want to let me scroll to the right. See photo.

enter image description here

I'm sure I'm using this wrong. Would anyone be able to help me out?

Thanks so much!

asked Dec 29, 2022 at 21:12

1 Answer 1

2

I'd preferably like to see line-by-line annotations of where time is spent not just per-function. I haven't figured out how to do this.

Double-clicking a function in the call tree view opens the source view, which shows line-by-line statistics.

The following articles should help you interpret the data Instruments generates:

answered Dec 29, 2022 at 22:27
Sign up to request clarification or add additional context in comments.

2 Comments

This helps a lot! Thank you, but how do I control which lines are annotated? Sometimes none of the lines have an annotation. While I get that not all code has a hot spot, I do want to see what is doing what.
You don't control which lines are annotated. I assume you're using the Time Profiler instrument. The point of that instrument is to find the slow spots in your code, not to tell you how much time your app spends in each line of code. You would need to insert profiling code in your source code to get information like how much time your app spends in each line of code.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.