Code Monkey home page Code Monkey logo

Comments (3)

GomteshM avatar GomteshM commented on July 3, 2024

Here is the screenshot of CPU usage: image

Steps to produce issue:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python trimesh_windowed_scene_viewer.py

from trimesh.

mikedh avatar mikedh commented on July 3, 2024

Hey, you could try running with profiling pip install pyinstrument and scene.show(profile=True). Although it is a debug viewer and is not massively optimized (and also due for a Pyglet 2 re-write one of these days). Yeah it's probably mostly that the framerate is way higher than it needs to be, maybe we could do something like this locked to the monitor refresh rate:

https://stackoverflow.com/questions/62824594/how-to-limit-fps-in-pyglet-window-on-draw-event

from trimesh.

GomteshM avatar GomteshM commented on July 3, 2024

Thanks mikedh for the suggestions,.

I used scene.show(profile=True) and I got following output:

 _     ._   __/__   _ _  _  _ _/_   Recorded: 10:00:02  Samples:  3462
 /_//_/// /_\ / //_// / //_'/ //     Duration: 8.054     CPU time: 31.638
/   _/                      v4.6.2

Program:  pyinstrument trimesh_scene_viewer.py

8.053 <module>  trimesh_scene_viewer.py:1
├─ 7.437 Scene.show  trimesh/scene/scene.py:1255
│     [38 frames hidden]  trimesh, pyglet, <built-in>, numpy, p...
│        4.388 select  <built-in>
├─ 0.338 <module>  yourdfpy/__init__.py:1
│     [10 frames hidden]  yourdfpy, trimesh, scipy
└─ 0.277 load  yourdfpy/urdf.py:931
      [19 frames hidden]  yourdfpy, trimesh

I tried other solution, but still the CPU usage is really high.

I guess, in future when Pyglet stable version 2.x.x is released then maybe new functionalities could be useful.

from trimesh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.