-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate on how to reduce the CPU usage when a new dataset is loaded #24
Comments
Probably an obvious question, but I am missing something: how can you understand this from the output you posted? |
As you can see here the
From the documentation
|
Thanks, I wonder how I was not able to see it before. |
Bytheway if you noticed here #24 (comment) the |
Yes, probably having some kind of set_transforms to set all the transforms at once would be useful (this was exactly the bottleneck in the MATLAB visualizer). It may be worth to check what they do in Drake. |
|
So it's similar to what we do in our code
|
@GiulioRomualdi when debugging, it's often more useful ordering the function calls with
This being said, I also noticed in another application that meshcat is pretty slow when sending the json message with the new link transform. Multiply this time for all the links and you can easily get the problems that have occurred here. Though, I couldn't find any way to send a single message containing multiple transforms. |
However, if the problem is sending the transform to meshcat, I am not sure why this happens only when loading a dataset and not when the dataset is played back. |
Ops. I should explain it better. This happens only after loading the dataset (so also when it is played back). If the dataset is not loaded the |
@diegoferigo I sorted the list by
|
Related to duburcqa/jiminy#543 |
In the past few days, I noticed that the application is greedy for resources. This happens when a new dataset is loaded. Indeed on the
icub-console-gui
the CPU usage jumps to160%
when the dataset is loaded. I tried to investigate the problem and I noticed that the thread related to meshcat requires more than its period (0.02s) to compute a cycle.robot-log-visualizer/robot_visualizer/meshcat_provider.py
Lines 35 to 56 in bdb99ce
In the beginning, I thought that the problem was related to the dynamical allocation of the vector associated with the robot joints and the base pose every time
set_multy_body_system_state
is called.robot-log-visualizer/robot_visualizer/meshcat_visualizer.py
Lines 198 to 217 in bdb99ce
I reduced the time this memory allocation is performed (associated PR: robotology/idyntree#959) but the problem was still there.
To better understand the problem I wrote a simple script that isolates the "slow" function (
set_multy_body_system_state
) (I know there is a typo. I'm sorry for that 😞)Accordingly to the outcome seems that the bottleneck is caused by the
send
function inside the meshcat package. I am afraid that we should increase the period of the meshcat thread in order to avoid undesired behavior in the application.@traversaro @diegoferigo @isorrentino @paolo-viceconte @RiccardoGrieco @S-Dafarra do you have any idea on how to avoid this problem?
The text was updated successfully, but these errors were encountered: