If I put the @log_sparse
decorator above the main function, I do not see the processes from the pool of processes that have been created.
On the contrary, if I put the log_sparse
decorator on top of my_function
, I do not see what the main process is doing and what happens in between the call of that function and this is what would be really interesting to me!
I launch the profiling from the CLI with:
\nviztracer --pid_suffix --output_dir ./outputDir --log_sparse test.py\n
What am I missing?
\nThanks in advance for your help :)
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"First of all, if you want to understand your program, you probably should not use log_sparse
. That's for cases where you are only interested in the time spent on a specific function. log_sparse
by default does not log children functions. So if you put that to main()
, it'll only log main()
, not any other function calls. That's what sparse
means.
As for the UI, it's perfetto so you can check their docs out. I believe all the colors correspond to some CPU usage. The black bar is probably the number function calls starting at that time period. The green one on the process is normally the frequency of function calls as well. Because you only have too few calls, they might not quite make sense. They will be if your trace file is more comprehensive.
","upvoteCount":1,"url":"https://github.com/gaogaotiantian/viztracer/discussions/407#discussioncomment-8547752"}}}-
Hi everyone, I would like to use viztracer to better understand why my code does not scale well with multiprocessing. Here is the code:
If I put the On the contrary, if I put the I launch the profiling from the CLI with:
What am I missing? Thanks in advance for your help :) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
First of all, if you want to understand your program, you probably should not use As for the UI, it's perfetto so you can check their docs out. I believe all the colors correspond to some CPU usage. The black bar is probably the number function calls starting at that time period. The green one on the process is normally the frequency of function calls as well. Because you only have too few calls, they might not quite make sense. They will be if your trace file is more comprehensive. |
Beta Was this translation helpful? Give feedback.
First of all, if you want to understand your program, you probably should not use
log_sparse
. That's for cases where you are only interested in the time spent on a specific function.log_sparse
by default does not log children functions. So if you put that tomain()
, it'll only logmain()
, not any other function calls. That's whatsparse
means.As for the UI, it's perfetto so you can check their docs out. I believe all the colors correspond to some CPU usage. The black bar is probably the number function calls starting at that time period. The green one on the process is normally the frequency of function calls as well. Because you only have too few calls, they might not quite make sense.…